|
Hi, I have a VbScript file that has oSQLServer.Connect statement using windows authentication. I am trying to pass the servername as parameter from command line. cscript ScriptJobs.vbs KIRAN\SECONDARY this value KIRAN\SECONDARY should be passed as the servername. I have the following code
However, the parameter that i pass in command line is not being taken as input into the ServerName. Please help me out with this
(comments are locked)
|
|
Safe to say I'm not the greatest vbscript writer but on the line oSQLServer.Connect "& ServerName" should the & be in the quotes? and also what value are you passing to the script? If the server has a named SQL instance then you might need to wrap it in [] so it might need to be like [MyServer\SQLInstanceName]. Can you connect to the SQL Server by other means from the PC where this problem exists? You might try using a UDL file to test it. Thanks for replying. Found the problem with the code. Have to remove set in SET SERVERNAME= statement. Take care
Apr 21 '10 at 05:36 PM
Kiran 1
(comments are locked)
|

