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
Explain transaction server consistency?
What is log cache in sql server?
Explain how to use linked server?
how we use window authentication connection with sql server.?
What is the difference between for xml raw and for xml auto?
How check triggers in sql server?
What are number line correlation administrators will use while working with a subquery?
How to create an multi-statement table-valued function?
What is de-normalization in sql database administration? Give examples?
Where does the copy job runs in the log shipping primary or secondary? : sql server database administration
Give me a SQL Query to find out the second largest company?
What is primary key and example?
How to optimize stored procedures in sql server?
Explain unique key in sql server?
Explain how would you store your query in an SSRS report or a Database server?