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.

 All Forums
 SQL Server 2000 Forums
 SQL Server Development (2000)
 double quotes in isql

Author  Topic 

cbeganesh
Posting Yak Master

105 Posts

Posted - 2004-10-26 : 16:01:39
I have a batch file which calls a stored procedure using isql.
Im passing the parameter in double quotes and isql bombs out.
is there any way to overcome this issue
The batch file is called using a third party software and it calls the batch file with paramter in quotes
example
c:>test.bat "MARKET.ZIP"
I want to call a stored procedure passing MARKET.ZIP to the procedure
any help?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2004-10-26 : 16:19:57
Please post the entire xp_cmdshell line of code.

Tara
Go to Top of Page

cbeganesh
Posting Yak Master

105 Posts

Posted - 2004-10-26 : 16:26:33
This is in the batch file

echo %1
isql -Sdev02 -Usa -Pgen -dtestdb -Q "exec usptest 'dev02',%*,'admin','mercury'"


And i call the batch file like this
c:> test.bat "market.zip"
Go to Top of Page

kselvia
Aged Yak Warrior

526 Posts

Posted - 2004-10-26 : 20:06:34
Look at HELP SET from a command prompt.
To replace " in %1 with '

set p=%1
set p=%p:"='%
isql -Sdev02 -Usa -Pgen -dtestdb -Q "exec usptest 'dev02',%p%,'admin','mercury'"

I hope that's not your real sa password :)

--Ken
I want to die in my sleep like my grandfather, not screaming in terror like his passengers.
Go to Top of Page

cbeganesh
Posting Yak Master

105 Posts

Posted - 2004-10-27 : 10:01:08
Thanks ken

It worked...

Gan
Go to Top of Page
   

- Advertisement -