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 |
What are the 2 types of classifications of constraints in the sql server?
What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?
If you're given a raw data table, how would perform etl (extract, transform, load) with sql to obtain the data in a desired format?
I have a table in which phno is one of the columns.i do have some values in tht phno column.i need to update phno column values with 0(zero) as prefix.give me a correct solution plz...
what is sql injection?
Which is the best place or learning center for MS SQL?????In Bangladesh?????
How do you size a resultset?
Wht is SQL Injection Attack ?
what is the difference between group and having give an example with query and sample output
What do you mean by table and field in sql?
What is db stored procedure?
In performance wise distinct is good or group by is good? eg:select name from emp group by name; select distinct name from emp;
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)