May 20, 2008 at 3:35 am
Hi All,
I am thinking of running some set of SQL commands, but as these includes a series of checks, I am thinking of possibly creating a stored procedure that will run these checks and email me the results.
I am looking at various options, first of all is it possible to use sp_executesql to save the results of a query into another parameter ?
Another way to get the results of queries, is to put this in a job and allow it to spool the results in a file using SQL agent.
Is there another way to trap sql query results ?
Thanks in advance.
May 20, 2008 at 5:12 pm
Wouldn't INSERT/EXEC do the job you're looking for?
--Jeff Moden
Change is inevitable... Change for the better is not.
May 21, 2008 at 5:47 am
Hi,
I didnt quite get the insert/exec idea, do you mean save the results in a table ?
The problem is the results that I expect back can be in different formats.
Thanks
May 21, 2008 at 7:07 pm
Yes... the INSERT/EXEC would be used to save the results in a table. If you get different results, use more than 1 table... nothing wrong with that.
Of course, you can also do things like making a view instead of a sproc depending on the nature of what you're trying to return. Also, a well designed table-valued function could do the trick. Neither of those methods will help with an existing sproc, though.
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply