FETCH NEXT FROM rs into @a,@b,@c
解决方案 »
- 关于组合统计的问题(高手进)
- 谁帮忙看看这个语句出错在哪?
- sql2000中有UPDATE TOP语句吗?
- 存储过程传入两个参数,第一个是 id in (1,5,6) ,第二个是 name='aaa',老问题,不知道高手怎么写的,vb6中执行
- SQL SERVER 2005 行变列?
- 请问有什么工具或者直接的SQL语句,可以实现下面的功能?
- mssql中连接ACCESS数据库的字符串 并操作数据库 比如添加数据 删除数据 修改表结构的语句 改怎么写
- SQL Server Compact 3.5问题
- 请问日期型数据怎样比较大小,及其比较规则?
- 我sqlserver2005中的存储过程被加锁了,如何才能修改其中的语句
- 联合查询 去除重复和无从关系的
- 需要解决:sql2008触发器问题
declare @shouID int,@Integrations nvarchar(50),@cause nvarchar(50)
DECLARE rs CURSOR LOCAL SCROLL FOR
select Integrations,shouid,cause from mm_account where addtime <= getdate()
OPEN rs
FETCH NEXT FROM rs
into @Integrations,@shouID,@cause
WHILE @@FETCH_STATUS = 0
BEGIN
update china_user set Integration=Integration+ @Integrations where id=@shouID
insert into china_account(userid,Integrations,symbol,cause) values(@shouid,@Integrations,1,@cause)
END
FETCH NEXT FROM rs
into @Integrations,@shouID,@cause
CLOSE rs
delete from mm_account where addtime <=getdate()
GO