Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Suppressing output from a stored procedure.


Suppressing output from a stored procedure.

Author
Message
Jeff Moden
Jeff Moden
SSC-Forever
SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)SSC-Forever (45K reputation)

Group: General Forum Members
Points: 45147 Visits: 39923
opc.three (4/26/2013)
A proper solution would be to get rid of the use of xp_cmdshell all together.

The recommended way using either a SQL Agent job or a web service that invokes the package. Both are decoupled from the caller, which is how it should be:

Loading and Running a Remote Package Programmatically


Heh... so far as I'm concerned, the "proper" way would be to get rid of the SSIS package and do it in TSQL. No call to anything required for that. ;-)

--Jeff Moden

RBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.
First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.
Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.
Although change is inevitable, change for the better is not.
Just because you can do something in PowerShell, doesnt mean you should. Wink

Helpful Links:
How to post code problems
How to post performance problems
Forum FAQs
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8249 Visits: 14368
Jeff Moden (4/29/2013)
opc.three (4/26/2013)
A proper solution would be to get rid of the use of xp_cmdshell all together.

The recommended way using either a SQL Agent job or a web service that invokes the package. Both are decoupled from the caller, which is how it should be:

Loading and Running a Remote Package Programmatically


Heh... so far as I'm concerned, the "proper" way would be to get rid of the SSIS package and do it in TSQL. No call to anything required for that. ;-)

I guess so, unless you consider xp_cmdshell nothing. No free lunch Jeff.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8249 Visits: 14368
Just for fun, how would you rewrite the SSIS package using only T-SQL to "generate a couple of excel spreadsheets, and email them."?

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
TaylorMade
TaylorMade
SSC-Addicted
SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)SSC-Addicted (486 reputation)

Group: General Forum Members
Points: 486 Visits: 210
badOedipus (4/26/2013)
I'm posting on this old post mainly for completeness and to help anyone else out that has this same issue.

I'm not sure how far back this goes, but I know it works in SQL Server 2008 r2.
the xp_cmdshell command has an optional parameter to specify no output. In your example here your sp would have a line like this:

exec xp_cmdshell @cmd, no_ouput



BadOed


Thank you so much for this info, was banging my head up against this problem.

However, for completeness again, there is a typo in the above line, should be "no_output".

For whoever this might help, this helped solve the issue I had when trying to run an ssrs report that called a stored procedure which initially called a ssis package, then built up a dataset. Without the no_output parameter, the ssrs report was trying to work against the "output" results information from the ssis package.

Again, THANK YOU so much.
Orlando Colamatteo
Orlando Colamatteo
SSCrazy Eights
SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)SSCrazy Eights (8.2K reputation)

Group: General Forum Members
Points: 8249 Visits: 14368
TaylorMade (11/13/2013)
badOedipus (4/26/2013)
I'm posting on this old post mainly for completeness and to help anyone else out that has this same issue.

I'm not sure how far back this goes, but I know it works in SQL Server 2008 r2.
the xp_cmdshell command has an optional parameter to specify no output. In your example here your sp would have a line like this:

exec xp_cmdshell @cmd, no_ouput



BadOed


Thank you so much for this info, was banging my head up against this problem.

However, for completeness again, there is a typo in the above line, should be "no_output".

For whoever this might help, this helped solve the issue I had when trying to run an ssrs report that called a stored procedure which initially called a ssis package, then built up a dataset. Without the no_output parameter, the ssrs report was trying to work against the "output" results information from the ssis package.

Again, THANK YOU so much.

How creative. May I ask you a question about your solution? How is the SSRS data source setup? I am curious to know how the principal running the report, whether it be the user running the report or some service account (SQL or Windows), is granted access to run xp_cmdshell. You could have left yourself exposed in terms of who can run xp_cmdshell.

__________________________________________________________________________________________________
There are no special teachers of virtue, because virtue is taught by the whole community. --Plato
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search