tsql - T-SQL Stored Procedure Get No Result -
is there way suppress results stored procedure result set?
that has both exec
, select
statements.
edit: let me explain problem little bit more.
the exec statement dtsrun pulls data erp , mysql servers temp tables in sql. once data in temp tables. there select
statement brings merged data user. user ms access database sends through actual customer on via email. triggered webpage button on customer side "get report".
i want suppress first exec statement result set because don't want customer see dts output.
otherwise, suppress have ms access execute stored procedure pull select
statement itself.
there 10 better ways doing. wanted know how suppress result set of exec
statement while still running it.
set fmtonly on; go exec sp_who;
however, has side effects , weird issues. example, in sql server 2012 @ least, if procedure has #temp table, invalid object name error. erland sommarskog goes lot more detail here (just search page fmtonly
).
given updates (i had no idea trying suppress output of dtsrun call), think better answer is: add flag stored procedure, , depending on flag value, use no_output
argument xp_cmdshell
:
alter procedure dbo.whatever @suppressdtsoutput bit begin set nocount on; ... if @suppressdtsoutput = 1 begin exec master..xp_cmdshell 'dtsrun.exe whatever', no_output; end else begin exec master..xp_cmdshell 'dtsrun.exe whatever'; end ... end go
Comments
Post a Comment