C# Tutorials and offshore development in India
    Tutorials   Resources   Forum   Communities   Interview   Jobs   Projects   Offshore Development    
Silverlight Tutorials | Mentor | Code Converter | Articles | Code Factory | Computer Jokes | Members | Peer Appraisal | IT Companies | Bookmarks | Revenue Sharing |


Prizes & Awards
My Profile



Active Members
TodayLast 7 Days more...

New Feature: Community Sites: Create your own .NET community website and start earning from Google AdSense ! It's Free !




Syntax of @@FETCH_STATUS function in SQL Server


Posted Date: 05 Mar 2008    Resource Type: Code Snippets    Category: SQL

Posted By: Ashwini Rupert       Member Level: Diamond
Rating:     Points: 10



The following code sample shows the use of @@FETCH_STATUS function in SQL Server



DECLARE Cursor_Name CURSOR FOR
SELECT
column1,
column2
FROM
tablename

OPEN Cursor_Name
FETCH NEXT FROM Cursor_Name
WHILE @@FETCH_STATUS = 0
BEGIN
FETCH NEXT FROM Cursor_Name
END
CLOSE Cursor_Name
DEALLOCATE Cursor_Name
GO






Responses

Author: Kapil Dhawan    17 Jun 2008Member Level: Gold   Points : 2
Hello
Nice piece of code
Thanks for sharing your knowledge with us.
I hope to see more good code from your side
This code will help lots of guys
Thanks to you
Regards,
Kapil








Author: mani kumar.k.m    26 Jul 2008Member Level: Gold   Points : 1
Hi Ashwini ,

where we use the FETCH_STATUS function,

can you give me some explain.

how to use it.

Thanks in advance.


Feedbacks      
Popular Tags   What are tags ?   Search Tags  
(No tags found.)

Post Feedback


This is a strictly moderated forum. Only approved messages will appear in the site. Please use 'Spell Check' in Google toolbar before you submit.
You must Sign In to post a response.
Next Resource: How to use @@ERROR in SQL Server to track errors
Previous Resource: How to get the version of SQL Server
Return to Discussion Resource Index
Post New Resource
Category: SQL


Post resources and earn money!
 
Related Resources



dotNet Slackers   BizTalk Adaptors    Web Design

Help Desk

Contact Us    Privacy Policy    Terms Of Use