Control statements

Last Post 11 Mar 2010 09:23 AM by PaulMcKibben. 2 Replies.
AddThis - Bookmarking and Sharing Button
Author Messages
PaulMcKibben
New Member
New Member

--
11 Mar 2010 06:49 AM
I am trying to print a message based on the value of a variable.

I have tried:

IF @DEMOCNT = 0
PRINT 'Pass'
ELSE
PRINT 'Fail'

I have also tried

'Result' =
CASE
WHEN @DEMOCNT = 0 THEN
BEGIN
'Pass'
PRINT 'Pass'
END
ELSE
BEGIN
'Fail'
PRINT 'Fail'
END
END

Both with no success. Any suggestions are appreciated.
gunneyk
New Member
New Member

--
11 Mar 2010 08:25 AM
Well what exactly do you mena by failed? Do you get an error or is it printing the wrong thing? Can you give a repro? I woould like to see the declare and setting of the variable.
PaulMcKibben
New Member
New Member

--
11 Mar 2010 09:23 AM
I resolved it. I was including it in a select statement.

Thank you


Acceptable Use Policy
---