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
 SQL Server Development (2000)
 Stored procedure problem

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-03-21 : 00:26:36
Matthew writes "Hi!

I'm wondering if it's possible to perform this logic in a stored procedure.

*********************************************

SELECT name, type FROM members WHERE id = 3

IF type = "business" THEN
DO SOMETHING

*********************************************

I want to reference the column TYPE from a SELECT statement that is run in the stored procedure directly. Instead of having to do this:

SET @type = SELECT type FROM members WHERE id = 3

And is there a way to reference the results of a select statement run in a stored procedure in the above fashion?

Thanks."

Nazim
A custom title

1408 Posts

Posted - 2002-03-21 : 00:33:18
How about this

select @type= type FROM members WHERE id = 3






--------------------------------------------------------------
Go to Top of Page
   

- Advertisement -