My businesses application supports only reporting with selected data from SQL server.In one business process I have very complicated stored procedure which using others stor
There is also one rough and probably BAD way to get selected data from print commands inside stored procedure.
Command xp_cmdshell and sqlcmd can do the JOB. Xp_cmdshell is mostly disabled and not allowed to use at most of SQL servers because of security reasons.
Here is code:
CREATE TABLE #temp
(OUTPUT VARCHAR(MAX));
declare @cmd varchar(800);
set @cmd = 'sqlcmd -d RobotTest -Q "exec sp_test_print_out"';
INSERT INTO #TEMP
exec xp_cmdshell @cmd ;
select output from #temp;
drop table #temp;