I need to be able to assign either one of two values to a local variable in a stored proc depending on what is returned from a boolean type statement.
Basically if this statement returns true:
if exists
(
select sc.*
from syscolumns sc
inner join sysobjects so on sc.id = so.id
where upper(sc.name) = 'title'
and upper(so.name) = 'Master6'
)
I want to declare the variable as 'title'
otherwise I want to declare the variable as ' '
Is this possible?
Basically if this statement returns true:
if exists
(
select sc.*
from syscolumns sc
inner join sysobjects so on sc.id = so.id
where upper(sc.name) = 'title'
and upper(so.name) = 'Master6'
)
I want to declare the variable as 'title'
otherwise I want to declare the variable as ' '
Is this possible?