Write the Syntax for Cursors.
Answers were Sorted based on User's Feedback
Answer / 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 |
Answer / ranjith kumar
declare cursor_name cursor for
select * from table_name
open cursor_name
fetch next from cursor_name
Is This Answer Correct ? | 6 Yes | 2 No |
How to populate a table in sql server?
What is tabulation?
What is MSDE?
What are the different index configurations a table can have?
I Have Employee table having column name as ID,SALARY how to get second max salary from employee table with id ex ID SALARY 1 20000 7 37000 2 5000
17 Answers HCL, IBM,
How can I create a new template for import ? : sql server management studio
What is the need for group functions in sql?
What is the difference between stored procedure and user defined functions?
What is Extended user-defined?
How do you debug a procedure in sql server?
how can you move the master database
How can you insert null values in a column while inserting the data?