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
 SQL Server 2005 Forums
 Transact-SQL (2005)
 CASE Statement w/ CURSOR
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

darms21
Yak Posting Veteran

54 Posts

Posted - 03/21/2013 :  15:19:16  Show Profile  Reply with Quote
Greetings,
I want to use the output of a CURSOR statement in a CASE statement as follows:

CURSOR Output:
ID
1
2
3

Select *,
CASE WHEN @ID = X THEN @ID....

robvolk
Most Valuable Yak

USA
15663 Posts

Posted - 03/21/2013 :  17:00:26  Show Profile  Visit robvolk's Homepage  Reply with Quote
Can you explain what (not how) you're trying to do and post the entire code you're currently using? It's very likely you do not need a cursor. From what you've already posted you could accomplish it with a JOIN.
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.06 seconds. Powered By: Snitz Forums 2000