Advertisement

10.17.2007 at 10:53AM PDT, ID: 22899750
[x]
Attachment Details

Differences when using osql vs sqlcmd

Asked by jpelldev in SQL Server 2005

Tags: vs

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\Finance\Actuals_CustVal\Act_Mem_Val\X18Y_FBP_Act_Mem_Val_10172007_132822_Report_1.txt  

NEW Statement
sqlcmd -E  -S EMISTEST -d DCRVW000 -Q usp_act_MEM_Load_Balances_custval -o \\AVST404\EMIS_Batch\Finance\Actuals_CustVal\Act_Mem_Val\X18Y_FBP_Act_Mem_Val_10172007_132822_Report_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
[+][-]10.17.2007 at 01:03PM PDT, ID: 20096555

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zone: SQL Server 2005
Tags: vs
Sign Up Now!
Solution Provided By: authentify
Participating Experts: 1
Solution Grade: B
 
 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628