![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all, I have a DTS with "Execute Process Task" and I tried to execute "osql.exe" with the following parameters, and was executed correctly /U roberto /P c3tech /w 1000 /Q "select * from Parts where ItemNumber = '' " /o "c:\PartsPartNumber.txt" but when I tried to execute with the following query the process raise an error, /U roberto /P c3tech /w 1000 /Q "select * from Parts where ItemNumber like ' %' or ItemNumber = '' " /o "c:\PartsPartNumber.txt" the diference between the two parameters are the following ItemNumber like ' %' or I suppose % mean 'Environment Variable', How can I write the - like ' %' - statement correctly? Thanks in advance. Alfredo (C3) |
#3
| |||
| |||
|
|
I am unclear about if you want to use an environment variable or you think it is getting confused with an environment variable due to the syntax. A simple test from a DOS prompt seems to work fine, when I use % as the standard wildcard pattern in a LIKE filter, so can you clarify what you want and also post any error messages. My working test command was - osql /E /Q "select * from sysobjects where name like 'a%' " Why don't you use the Execute SQL Task over osql since that is really the most appropriate method of executing some SQL in DTS. -- Darren Green http://www.sqldts.com "Alfredo C3" <alfredo (AT) myhostserver (DOT) com> wrote in message news:u415a1Y4EHA.1564 (AT) TK2MSFTNGP09 (DOT) phx.gbl... Hi all, I have a DTS with "Execute Process Task" and I tried to execute "osql.exe" with the following parameters, and was executed correctly /U roberto /P c3tech /w 1000 /Q "select * from Parts where ItemNumber = '' " /o "c:\PartsPartNumber.txt" but when I tried to execute with the following query the process raise an error, /U roberto /P c3tech /w 1000 /Q "select * from Parts where ItemNumber like ' %' or ItemNumber = '' " /o "c:\PartsPartNumber.txt" the diference between the two parameters are the following ItemNumber like ' %' or I suppose % mean 'Environment Variable', How can I write the - like ' %' - statement correctly? Thanks in advance. Alfredo (C3) |
![]() |
| Thread Tools | |
| Display Modes | |
| |