sql,cursor

Osman 8/7/2016 1people says helpful

this code shows how to use cursor in sql

Transact-SQL
declare @alltags nvarchar (250)
declare @titlename nvarchar (250)
declare @titleid bigint

declare crs_title cursor for
select TitleID, TitleName from Titles

open crs_title

fetch next from crs_title into @titleid, @titlename

while @@FETCH_STATUS =0
       begin
      
             --do anything
             fetch next from crs_title into @titleid, @titlename
       end
close crs_title
deallocate crs_title
 

Report Bug

Please Login to Report Bug

Reported Bugs

Comments

Please Login to Comment

Comments