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)
 Send field as variable to Stored Proc

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2001-09-13 : 09:54:00
Hendrik writes "Hello,

I have a table with four yes/no (bit) fields in in.

I want to check through a Stored Proc is one of those fields is set True. Because I do not want to make a Stored Proc for each of the four fields I need to send the field to be checkes as a variable to the Stored Procedure. So it would become something like this:


Create Procedure sp_checkField
@field varchar
As
Select @field
From tbl_Table
Where @field = 1
Go



Is something like that possible? And, if not, what would be a good alternative?


Thanks in advance,


Hendrik."
   

- Advertisement -