sqdperu
asked on
Changing scripts from using isql to sqlcmd - global replace?
I'm upgrading a sever that runs SQL server batch jobs. (The databases are actually on a different server, but SQL server is installed on this "Scheduling" server.) The server I'm upgrading is SQL Server 2000 and on it's replacement server I will be installing SQL Server 2008 R2 (to be like the servers where the DBs reside).
The batch jobs on the server currently run scripts like this:
isql -Usa -Ppw -dDBname -iD:\SQL\OrderHist.sql -SserverName
We also run BCPs in them that look like this:
bcp DBname..TableName in H:\download\txt\file.txt /fD:\bcp\fmt\file.fmt /Usa /Ppw /SserverName /r\n /m100
Should I be able to do a search and replace on these bat files and replace all the "isql" with "sqlcmd" and the bat jobs run just fine on the new server?
What about the BCP - will the same command format for it work on 2008?
thanks
The batch jobs on the server currently run scripts like this:
isql -Usa -Ppw -dDBname -iD:\SQL\OrderHist.sql -SserverName
We also run BCPs in them that look like this:
bcp DBname..TableName in H:\download\txt\file.txt /fD:\bcp\fmt\file.fmt /Usa /Ppw /SserverName /r\n /m100
Should I be able to do a search and replace on these bat files and replace all the "isql" with "sqlcmd" and the bat jobs run just fine on the new server?
What about the BCP - will the same command format for it work on 2008?
thanks
Obviously you will also need to change
<<
The batch jobs on the server currently run scripts like this:
isql -Usa -Ppw -dDBname -iD:\SQL\OrderHist.sql -SserverName
>>
like
sqlcmd -Usa -Ppw -dDBname -iD:\SQL\OrderHist.sql -SserverName
<<
The batch jobs on the server currently run scripts like this:
isql -Usa -Ppw -dDBname -iD:\SQL\OrderHist.sql -SserverName
>>
like
sqlcmd -Usa -Ppw -dDBname -iD:\SQL\OrderHist.sql -SserverName
ASKER
"Obviously you will also need to change ... "
That's my question. Can I just change the "isql" to "sqlcmd" in all my jobs and the parameters that follow that worked with "isql" will work just fine using "sqlcmd"?
Is "sqlcmd" completely backwards compatible with how the parameters worked with "isql"?
I'm looking for comfirmation from someone who has actually tried this and know that it works.
That's my question. Can I just change the "isql" to "sqlcmd" in all my jobs and the parameters that follow that worked with "isql" will work just fine using "sqlcmd"?
Is "sqlcmd" completely backwards compatible with how the parameters worked with "isql"?
I'm looking for comfirmation from someone who has actually tried this and know that it works.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
"There is no way for us to guarantee that the SQL running with a different version of SQL server is going to work the same way as it did on the prior version of SQL server. But the command line parameters are the same format for ISQL or OSQL or SQLCMD. "
I plan to test all the jobs on a test server. I was just looking for a starting point and it sounds like a global change and test would be it. thanks.
I plan to test all the jobs on a test server. I was just looking for a starting point and it sounds like a global change and test would be it. thanks.
then you don't have to change all your scripts.
BCP shouldn't need to change.