sqlserver 游標的簡單示例
更新時間:2008年10月01日 00:02:53 作者:
比較簡單的例子,學(xué)習sqlserver游標
Declare @Id varchar(20)
Declare @Name varchar(20)
Declare Cur Cursor For
select substring(id,0,7) as id,name from temp1
Open Cur
Fetch next From Cur Into @Id,@Name
While @@fetch_status=0
Begin
Update temp Set [c3]=@Name where [id] like @Id+'%'
Fetch Next From Cur Into @Id,@Name
End
Close Cur
Deallocate Cur
Declare @Name varchar(20)
Declare Cur Cursor For
select substring(id,0,7) as id,name from temp1
Open Cur
Fetch next From Cur Into @Id,@Name
While @@fetch_status=0
Begin
Update temp Set [c3]=@Name where [id] like @Id+'%'
Fetch Next From Cur Into @Id,@Name
End
Close Cur
Deallocate Cur
相關(guān)文章
sql注入過程詳解_動力節(jié)點Java學(xué)院整理
這篇文章主要為大家詳細介紹了sql注入過程的相關(guān)資料,具有一定的參考價值,感興趣的小伙伴們可以參考一下2017-08-08
hive中將string數(shù)據(jù)轉(zhuǎn)為bigint的操作
這篇文章主要介紹了hive中將string數(shù)據(jù)轉(zhuǎn)為bigint的操作,具有很好的參考價值,希望對大家有所幫助。一起跟隨小編過來看看吧2020-09-09
sqlserver數(shù)據(jù)庫獲取數(shù)據(jù)庫信息
這篇文章主要介紹了sqlserver數(shù)據(jù)庫獲取數(shù)據(jù)庫文件信息,大家參考使用吧2014-01-01

