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

Where do you find the default Index fill factor and how to change it?

0 Answers  


How you can move data or databases between servers and databases in sql server?

0 Answers  


What is efficiency data?

0 Answers  


how to dispaly a particular row details from a given table

2 Answers  


What are all new concepts in SQL Server 2008? That is Exactly Difference between 2005 to 2008

2 Answers   IBM,


what purpose does OPENXML clause have in sql server stored procedure?

1 Answers  


What are the factors you will check for the performane optimization for a database query?

7 Answers   CarrizalSoft Technologies, DELL, SoftSol,


When cursors are useful?

0 Answers  


What are the different types of queries?

1 Answers  


what is replication? where do u use Go Keyword?

1 Answers   Satyam,


How to create and drop temp table in sql server?

0 Answers  


How can we delete Duplicate row in table?

0 Answers   Wipro,


Categories