I have written a script which is like
declare @type int
set @type=(select type from person where personid=12 and departmentid=5)
If the query does not return anything it is not entering into the if loop.
What do I need to write in the if condition for it to enter even if the query does not return anything?