SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Cusor - weird results
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Chris_Kelley
Posting Yak Master

114 Posts

Posted - 08/09/2014 :  10:48:49  Show Profile  Reply with Quote
c

Edited by - Chris_Kelley on 11/11/2014 19:35:30

namman
Constraint Violating Yak Guru

USA
272 Posts

Posted - 08/09/2014 :  11:34:28  Show Profile  Reply with Quote
DECLARE TEST_CURSOR CURSOR FAST_FORWARD
FOR
SELECT FIRSTNAME,LASTNAME,BIRTHDAY FROM #TEST ORDER BY BIRTHDAY ASC
OPEN TEST_CURSOR
FETCH NEXT FROM TEST_CURSOR
INTO @FIRSTNAME,@LASTNAME,@BIRTHDAY
PRINT @FIRSTNAME + ' ' + @LASTNAME + ' ' + @BIRTHDAY
WHILE @@FETCH_STATUS = 0
BEGIN
-- code should be here
PRINT @FIRSTNAME + ' ' + @LASTNAME + ' ' + @BIRTHDAY
-- ------
FETCH NEXT FROM TEST_CURSOR
INTO @FIRSTNAME,@LASTNAME,@BIRTHDAY
PRINT @FIRSTNAME + ' ' + @LASTNAME + ' ' + @BIRTHDAY
END
CLOSE TEST_CURSOR
DEALLOCATE TEST_CURSOR

Edited by - namman on 08/09/2014 11:35:27
Go to Top of Page

Chris_Kelley
Posting Yak Master

114 Posts

Posted - 08/09/2014 :  12:36:27  Show Profile  Reply with Quote
c

Edited by - Chris_Kelley on 11/11/2014 19:35:37
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.05 seconds. Powered By: Snitz Forums 2000