I'm trying to write a stored proc, using the execute command as the select statement, but sql parser says 'no way.'
the command is this...
if exists ( exec ( 'select * from poll' + @pollnumber + ' where username = ' + @username ) )
the error is "Incorrect syntax near the keyword 'exec'."
is it even posible to use an execute command in place of the sql select statement with the if exists?