I have the following to create a stored procedure and it works fine, but I need to get the list of JobId's in the output without supplying parameters. Here is what I am trying to do:
The parameter is automatically entered through code.
SELECT id ,JobId
WHERE id = @id
At this point I want to know what JobId's are selected by the user and create a query that excudes the JobId from a Job List, basically:
WHERE JobId <> JobID_From_SELECT_STATEMENT_ABOVE
This would provide a list of jobs that the user has not selected.
Any thoughts. I have tried creating a function as well, but so far, no luck.