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

wt is mean by acid property? i know it is atomocity,consistency,isolation and durabulaty but wt is these mean and wt actions it's perform

1 Answers   Idea,


Explain syntax for viewing trigger?

0 Answers  


How to Debug a Stored Procedure?

5 Answers   Allianz,


Which command is used for user defined error messages?

0 Answers  


Why should we go for stored procedures? Why not direct queries?

0 Answers  


What is the difference between join and inner join?

0 Answers  


What is clustered index

0 Answers  


How does stuff differ from the replace function?

0 Answers  


Explain what is public role in sql server?

0 Answers  


How to generate random numbers with the rand() function in ms sql server?

0 Answers  


event classes in sql server

2 Answers   Accenture, AFE,


How many triggers are possible per table?

0 Answers  


Categories