|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 12:46 PM
Points: 2,749,
Visits: 1,406
|
|
|
|
|
|
SSC Journeyman
      
Group: General Forum Members
Last Login: Wednesday, May 15, 2013 3:42 AM
Points: 80,
Visits: 846
|
|
Good stuff!
Have you ever had the (mis)fortune to use MSbuild too?
Adam
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Today @ 4:31 AM
Points: 22,
Visits: 87
|
|
Fatal scripting error. Cannot open connection specified in the SQLCMD script. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
i got like that error when i do connect with the use of the sqlcmd.
|
|
|
|
|
SSC-Addicted
      
Group: General Forum Members
Last Login: Friday, July 30, 2010 11:27 AM
Points: 435,
Visits: 1,403
|
|
Excellent! I have reached the stage in life where if it isn't scripted, I screw it up. How nice to learn about yet another scripting strategy.
|
|
|
|
|
Forum Newbie
      
Group: General Forum Members
Last Login: Monday, March 28, 2011 12:09 PM
Points: 7,
Visits: 47
|
|
for the most bravest here is a perl script to run multiple sql scirpts ...
requirement: the scirpts should be numbered: 1.RUN.scriptname.sql 2.RUN.scriptName2.sql 3... n. RUN.scirptname3.sql
and placed in the same directory as the perl script
You can create a command line executable for it ( does not required Perl on the running machine ) with par or perl2exe ...
Anybody interested in ... I could put a link for binary download it ...
Grab the source at :
http://ysgitdiary.blogspot.com/2009/03/perl-script-to-run-sql-scripts-for-sql.html
Comments , shouts boos etc. would be highly appreciated .. .
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Thursday, April 25, 2013 8:57 PM
Points: 139,
Visits: 214
|
|
Great article, David. I had not seen examples of the error and standard outputs before.
Kuldip: it looks as though your windows login does not have windows integrated access to the server. You need to supply a SQL user name and password as part of the SQLCMD connect command or on the command line.
kuldip.bhatt (3/24/2009) Fatal scripting error. Cannot open connection specified in the SQLCMD script. Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection.
i got like that error when i do connect with the use of the sqlcmd.
|
|
|
|
|
Grasshopper
      
Group: General Forum Members
Last Login: Today @ 4:31 AM
Points: 22,
Visits: 87
|
|
how i give the usrename and password in the sql command?
:setvar Maindbserver "NHSserver" :setvar Maindb "NHS_031209" :Connect $(Maindbserver) go $ maindb
this is my code.
in this script how i can give user name and password?
My question is if diff servers has diffrent password then what is the solution for this.
you must give Password and usrename.
|
|
|
|
|
Mr or Mrs. 500
      
Group: General Forum Members
Last Login: 2 days ago @ 4:00 AM
Points: 533,
Visits: 2,285
|
|
OOh yes. SQLCMD! I agree wholeheartedly that it is an essential for quickly automating complex processes across several servers. I love it. It is so good that one is tempted to keep it to oneself, and amaze people with one's wizardry.
Robyn and I wrote a workbench a while back which might help as a follow-up to David's excellent introduction. The SQLCMD workbench
I notice that the SQL Server 2008 version of SQLCMD is very similar to that of SQL Server 2005. Have they improved anything, or is SQLCMD one of those tools they have left to fester?
Best wishes,
Phil Factor Simple Talk
|
|
|
|
|
Ten Centuries
      
Group: General Forum Members
Last Login: Yesterday @ 2:11 PM
Points: 1,409,
Visits: 4,506
|
|
|
|
|
|
SSCrazy
      
Group: General Forum Members
Last Login: Yesterday @ 12:46 PM
Points: 2,749,
Visits: 1,406
|
|
kuldip.bhatt (3/24/2009) how i give the usrename and password in the sql command?
:setvar Maindbserver "NHSserver" :setvar Maindb "NHS_031209" :Connect $(Maindbserver) go $ maindb
:connect $(Maindbserver) -U YourUserName -P YourPassword
Personally I would avoid SQL standard security for scripts like the plague. It would mean you have a clear text file with credentials exposed.
LinkedIn Profile
|
|
|
|