IF EXISTS(SELECT * FROM MyTable WHERE Condition=true)
SELECT * FROM MyTable WHERE Condition=true
ELSE
SELECT NULL AS Column1, NULL AS Column2, NULL AS Column3, [etc...]
very nice, I like it.
this works well assuming the initial exists query is fast, if its slow i guess you would have to weigh using a temp table vs using what you did above
MyronCope
Participant
1656 Points
1345 Posts
Re: have stored proc always return a blank record
Apr 06, 2012 01:38 PM|LINK
very nice, I like it.
this works well assuming the initial exists query is fast, if its slow i guess you would have to weigh using a temp table vs using what you did above