Declare @CategoryID as int BEGIN SELECT (CASE WHEN EXISTS( SELECT t0.Categoryid AS [EMPTY] FROM Categories AS [t0] WHERE [t0].Categoryname = @CategoryName ) THEN 1 ELSE 0 END) AS [value]
if I want to set my variable inside an existing block using t0.Categoryid, how can I do this?
I want to replace , then 1 with the category value <...>
thanks in advance.
sql sql-server sql-server-2008 exists
Vishal sharma
source share