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
How to drop an existing table?
Is a null value equal to anything? Can a space in a column be considered a null value? Why or why not?
How to delete duplicate records based on single column from a table?
Explain syntax for disabling triggers?
When columns are added to existing tables, what do they initially contain?
Define right outer join?
How to defragment table indexes?
What is encryption key?
Differentiate between mongodb vs. Sql server?
Determine when to use stored procedure to complete sql server tasks?
Do you know what guidelines should be followed to help minimize deadlocks?
What is the default schema of your login session in ms sql server?
What is bookmark link in ssrs?
Explain the different types of joins?
Why I am getting this error when dropping a database in ms sql server?