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
 General SQL Server Forums
 New to SQL Server Programming
 prerequisites for script to work on any instance

Author  Topic 

rtutus
Aged Yak Warrior

522 Posts

Posted - 2007-01-04 : 22:45:32
Hi
I need this script to work on any instance:

exec master..xp_cmdshell 'bcp mosaikDB741.dbo.FilelistInput in csvFilePath.csv -t -c -userName -Ppassword -Sinstance'

Can I customize it more in order if someone runs it on a different instance or server it won t fail. All he will need to replace is the username, password and make sure there is mosaikDB741.dbo.FilelistInput table and csvFilePath.csv file

Thanks a lot.

Michael Valentine Jones
Yak DBA Kernel (pronounced Colonel)

7020 Posts

Posted - 2007-01-05 : 09:55:56
Yes, you can.



CODO ERGO SUM
Go to Top of Page

rtutus
Aged Yak Warrior

522 Posts

Posted - 2007-01-05 : 16:30:14
how can I do that then
Go to Top of Page
   

- Advertisement -