I am running a stored procedure which produces a report via a batch process. In the past I have used the osql command. After implementing SQL Server 2005, I was asked to use sqlcmd instead.
OLD Statement
osql -E -S EMISTEST -d DCRVW000 -Q usp_act_MEM_Load_Balances_
custval -o \\AVST404\EMIS_Batch\Finan
ce\Actuals
_CustVal\A
ct_Mem_Val
\X18Y_FBP_
Act_Mem_Va
l_10172007
_132822_Re
port_1.txt
NEW Statement
sqlcmd -E -S EMISTEST -d DCRVW000 -Q usp_act_MEM_Load_Balances_
custval -o \\AVST404\EMIS_Batch\Finan
ce\Actuals
_CustVal\A
ct_Mem_Val
\X18Y_FBP_
Act_Mem_Va
l_10172007
_132822_Re
port_1.txt
The old method creates a report text file correctly but the new method does not. Also, the batch processing just seems to stop. It does not process any routines that are called after the statement to process the stored procedure.
I know that I can just use the old method for now but I am being asked to explain why the new method does not work and I cannot determine the reason.
Start Free Trial