all groups > sql server new users > february 2006 >
You're in the

sql server new users

group:

SPRoc question



SPRoc question Gary Wardell
2/6/2006 10:10:29 AM
sql server new users: Hi,

I'm sort of new to SQL and SQL Server.

In Query Analyzer; Is there a way to call a stored procedure from a select
statement so that I can filter and sort the output with where and ordered by
clauses to see what the stored procedure is returning for troubleshooting
purposes?

The stored procedure returns a single record set that may contain several
thousand multicolumn rows.

I want to avoid mucking with the stored procedure if at all possible.

Gary

Re: SPRoc question Raymond D'Anjou
2/6/2006 10:13:10 AM
[quoted text, click to view]

No.
This may help you out.
http://www.sommarskog.se/share_data.html

Re: SPRoc question Raymond D'Anjou
2/6/2006 10:29:49 AM
[quoted text, click to view]

I just understood a bit more of what you're asking.
One way is to copy the code from the SP to QA, converting parameters to
local variables.
You can do all the tweaking you want, testing with different parameter
values.

Re: SPRoc question Andrew J. Kelly
2/6/2006 10:49:08 AM
You can do something like this:

INSERT INTO YourTable (...) EXEC YourSp

Then you can query the results all you want.

--
Andrew J. Kelly SQL MVP


[quoted text, click to view]

AddThis Social Bookmark Button