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 2012 Forums
 Transact-SQL (2012)
 Conversion

Author  Topic 

Pete_N
Posting Yak Master

181 Posts

Posted - 2014-01-09 : 12:05:16
I am trying to write a stored procedure that is passed an integer Service. The integer will be anything from 1 - 15

i need to convert that integer to a bit where service value of 3 returns a false but all others return true, and load that result to a variable @Active ( bit)

russell
Pyro-ma-ni-yak

5072 Posts

Posted - 2014-01-09 : 12:46:03
[code]Create Proc MyProc
@param int
AS

Declare @Active bit = 1

IF @param = 3
SET @Active = 0

.. rest of code ...[/code]
Go to Top of Page
   

- Advertisement -