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

select top 5 * from emp order by newid() my question is , how this query get executed?

5 Answers  


What are approximate numeric data types in ms sql server?

0 Answers  


What do you mean by acid?

0 Answers  


How is foreign key related to primary key?

0 Answers  


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?

0 Answers  


What are the general features of sql server management studio? : sql server management studio

0 Answers  


How to find Duplicate Records In table?

0 Answers   HCL,


What is cursors?

0 Answers   NA,


what is the difference between count(*) and count(1) ?

0 Answers   MCN Solutions,


What is meant by dirty read?

0 Answers  


What are the system database in sql server 2005?

0 Answers  


Categories