Write the Syntax for Cursors.
Answer Posted / govardhana r
DECLARE @var1 varchar(20), @var2 varchar(20)
declare cursor_name cursor for
select val1,val2 from table_name
open cursor_name
fetch next from cursor_name
into @var1, @var2
while @@FETCH_STATUS = 0
begin
-----
-----
-----
fetch next from cursor_name
into @var1, @var2
end
close cursor_name
deallocate cursor_name
| Is This Answer Correct ? | 11 Yes | 0 No |
Post New Answer View All Answers
What is the difference between varchar and varchar(max) datatypes?
What do you understand by a stored procedure?
can we have a nested transaction? : Sql server database administration
What is the use of =,==,=== operators?
What do you mean by data integrity?
What is update_statistics command?
what is the information that can be stored inside a bit column? : Sql server database administration
Explain the steps needed to create a scheduled job?
How do you migrate data from mssql server to azure?
What is user-defined function? Explain its types i.e. Scalar and inline table value user-defined function?
Tell me the difference between clustered and non-clustered index?
What is difference between inner join and join?
Explain encryption of entire databases without the need for application changes in sql server 2008?
How do I find information about the install locations for the various instances running on a computer?
what is a major difference between sql server 6.5 and 7.0 platform wise? : Sql server database administration