Using execute process task in SSIS ,I am trying to execute a batch file which is having script as :
sqlcmd -S ServerName -d DataBasName -Q "EXECUTE store_procedure_name"%1 -o C:\Users\Desktop\exe_test\abc.txt -s "," -W
%1 passes arguments to store procedure. And I have used expressions to pass argument by using a variable in argument property.
Variable have an expression as :
"'"+(DT_WSTR, 20)@[User::v_ST_DT]+"'"+","+"'"+(DT_WSTR, 20)@[User::v_ED_DT] +"'"+","+(DT_WSTR, 20)@[User::v_ST_Key] +","+(DT_WSTR, 20)@[User::v_END_SCFL_LOAD_KEY]
Execute process task is executing very well. But in my abc.txt file I am getting statement as :
"Msg 105, Level 15, State 1, Server ServerName, Line 1
Unclosed quotation mark after the character string ''@[User::v_ST_DT]
'. "
for the @[User::v_ST_DT] value is 1/1/1900 3:23:00 PM.
Please help me in resolving this. Many Thanks in Advance!!