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 |
Which virtual table does a trigger use?
how do u find least salary in a table
What is indexing and its types?
what's the maximum size of a row? : Sql server database administration
When you use @@error and try-catch?
What is recursion? Is it possible for a stored procedure to call itself or recursive stored procedure? How many levels of sp nesting are possible?
How to swap the data of two columns in a table. both the columns containing varchar values.
How can we Use Linked Server? Uses of Linked server
What is use of attribute hierarchy ordered ? : sql server analysis services, ssas
What is forward - only cursors / read only cursor?
How to create a stored procedure with a statement block in ms sql server?
How to update muliple row in single query?
Oracle (3253)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)