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 2000 Forums
 Transact-SQL (2000)
 SELECT, CASE and RETURN

Author  Topic 

leahsmart
Posting Yak Master

133 Posts

Posted - 2003-05-30 : 06:16:24
Hello!

Me again. I have got the above all working nicey.

http://www.sqlteam.com/forums/link.asp?TOPIC_ID=26477

All I need now is to be able to write it. So I want to return a value of either 0 or 1. RETURN @Survey does not work. Do you have any ideas?



SET @Survey =
CASE
WHEN @NumberRows = 2 THEN 1
WHEN @NumberRows = 1 AND Survey = 1 THEN 0
WHEN @NumberRows = 1 AND Survey = 0 THEN 1
END

RETURN @Survey




Edited by - leahsmart on 05/30/2003 06:17:02

Andraax
Aged Yak Warrior

790 Posts

Posted - 2003-05-30 : 06:33:44
[url]http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=26477[/url]

=)

Go to Top of Page

ValterBorges
Master Smack Fu Yak Hacker

1429 Posts

Posted - 2003-05-30 : 09:32:22
Read the following
http://www.sqlteam.com/item.asp?ItemID=2644

http://www.asp101.com/samples/storedprocs.asp

http://support.microsoft.com/default.aspx?scid=http://support.microsoft.com:80/support/kb/articles/Q194/7/92.ASP&NoWebContent=1

http://www.adopenstatic.com/FAQ/SprocsAndParameters.asp

http://www.ragingsmurf.com/code.aspx?key=CWUSG9R3LW

Go to Top of Page
   

- Advertisement -