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 attach adventureworkslt physical files to the server?
Which tcp/ip port does sql server run on? How can it be changed?
Explain syntax for dropping triggers?
Name some of the open source software that you can use in alternative to SSR?
What is schemabinding a view?
Explain how to maintain a fill factor in existing indexes?
What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?
What command must you use to include the not null constraint after a table has already been created?
What is a view and what are its advantages?
In case you have filters in your report, when filters will be applied in cached report instance?
How much memory that we are using in Logshipping Concept?
What are ddl triggers and types of ddl trigger?
What are the types of database schema? : sql server analysis services, ssas
what are the different ways to return the rowcount of a table?
What is difference between foreign key and unique key?