Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


Write the Syntax for Cursors.

Answers were Sorted based on User's Feedback



Write the Syntax for Cursors...

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

Write the Syntax for Cursors...

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

Post New Answer

More SQL Server Interview Questions

What are the 2 types of classifications of constraints in the sql server?

0 Answers  


What is the difference between ROW_NUMBER and Ranking function in SQL SERVER?

0 Answers  


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?

0 Answers   Facebook,


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...

7 Answers   Value Labs,


what is sql injection?

2 Answers  


Which is the best place or learning center for MS SQL?????In Bangladesh?????

0 Answers   TCL, Wipro,


How do you size a resultset?

0 Answers  


Wht is SQL Injection Attack ?

3 Answers  


what is the difference between group and having give an example with query and sample output

7 Answers  


What do you mean by table and field in sql?

0 Answers  


What is db stored procedure?

0 Answers  


In performance wise distinct is good or group by is good? eg:select name from emp group by name; select distinct name from emp;

5 Answers   Infosys,


Categories