SQL SERVER的存储过程循环UPDATE语句怎么写?能不能给个例子啊???急......
解决方案 »
- 请教一个ntext的问题
- sql2005事件探查器问题,难度(中等)
- 这条语句写不出来,请高手帮忙!
- 数据库查询中返回您指定的行数,主键ID,但不连续,请问这样的语句如何写
- 这个SQL怎么写
- 数据库自动备份的问题
- 求助,关于重复记录的查询问题。
- 请各位帮我看一下这个Sql脚本的作用,谢谢了!
- 如何与text字段类型的值作比较?
- SQL SERVER一个表中的ID列是字符型的.newid为默认值的,在存储过程中,请问怎么取得刚加的这条记录的ID值?
- 请SQL SERVER类似ORACLE的desc tablename 显示表的属性的命令怎么写啊?
- 怎样解决MSSQL中生成SQL脚本时出现CreateFile错误
Update t2 Set t2.procwip=t2.procwip-t1.sunit From sheet1$ t1 Inner Join proscjhb t2 On t1.pdctno=t2.pdctno and t1.units=t2.units
Or
Update t2 Set t2.procwip=t2.procwip-t1.sunit From sheet1$ t1,proscjhb t2 Where t1.pdctno=t2.pdctno and t1.units=t2.units
select type from tb
for update of typedeclare @fetch_status intopen cur_Testfetch cur_Test
select @fetch_status=@@fetch_statuswhile @fetch_status=0
begin
update tb
set type='a' where current of cur_Test fetch cur_Test
select @fetch_status=@@fetch_status
endclose cur_Test
deallocate cur_Test
go
谢谢!
beginend
while not exists(select 1 from tablename where ...)
beginend