Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 CASE Statement w/ CURSOR

Author  Topic 

darms21
Yak Posting Veteran

54 Posts

Posted - 2013-03-21 : 15:19:16
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

15732 Posts

Posted - 2013-03-21 : 17:00:26
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
   

- Advertisement -