Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
stevenandler
Starting Member
42 Posts |
Posted - 2013-02-07 : 11:58:13
|
I am able to call the following command line program from T-SQLif I hard code the arguments like this!!C:\REPORT.EXE 1874 21665339However, I am not able to pass in T-SQL variables.DECLARE @PAT INTDECLARE @ORD INTSET @PAT = 1874SET @ORD = 21665339!!C:\REPORT.EXE @PAT @ORDCan someone please tell me how to do this? Thank you |
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-02-07 : 16:23:32
|
Are you using xp_cmdshell to run the command line program from T-SQL with hardcoded arguments? |
|
|
stevenandler
Starting Member
42 Posts |
Posted - 2013-02-07 : 17:29:03
|
No, but I am using the posted T-SQL commands with SQLCMD query activated. |
|
|
James K
Master Smack Fu Yak Hacker
3873 Posts |
Posted - 2013-02-07 : 18:04:45
|
I think you have to use SETVAR for this; I don't know of a way to force the substitution of T-SQL variables when invoking the system command. If you are able to use SETVAR, it would be something like this::setvar mydir "C:\Temp"!!dir $(mydir) |
|
|
|
|
|