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 |
select top 5 * from emp order by newid() my question is , how this query get executed?
What are approximate numeric data types in ms sql server?
What do you mean by acid?
How is foreign key related to primary key?
Can we execute a stored procedure inside a trigger?
6 Answers BirlaSoft, CarrizalSoft Technologies, United Healthcare,
Explain the steps needed to create a scheduled job?
What are the general features of sql server management studio? : sql server management studio
How to find Duplicate Records In table?
What is cursors?
what is the difference between count(*) and count(1) ?
What is meant by dirty read?
What are the system database in sql server 2005?
Oracle (3259)
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)