Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

sqlcmd Expand / Collapse
Author
Message
Posted Saturday, June 29, 2013 12:08 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, February 10, 2016 6:10 AM
Points: 51, Visits: 94
Hi All,

I am a newbie to sqlserver.I recently came across "sqlcmd"utility feature while surfing.So here is my doubt.
I connect to a server using some credentials.I do it like
--->Right click on ssms
--->Run as different user
--->give some credentials(domain/password)
How can I do the same using command prompt..When do we actually use "sqlcmd"feature.Please help me on this.It would be helpful..


Sorry the same post got passed 3 times..Dont know how to delete
Post #1468772
Posted Monday, July 1, 2013 1:43 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Thursday, June 23, 2016 2:47 PM
Points: 2,852, Visits: 3,341
You can use the -U and -P parameters. Take a look at http://msdn.microsoft.com/en-us/library/ms162802.aspx of the complete syntax.

** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
Post #1468963
Posted Monday, July 1, 2013 4:38 AM
Valued Member

Valued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued MemberValued Member

Group: General Forum Members
Last Login: Wednesday, February 10, 2016 6:10 AM
Points: 51, Visits: 94
Thanks Hanshi for introducing me to a new topic. I tried importing and exporting data. It works great!!!
Post #1468996
Posted Monday, July 1, 2013 7:14 PM


SSC-Forever

SSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-ForeverSSC-Forever

Group: General Forum Members
Last Login: Yesterday @ 9:57 PM
Points: 40,752, Visits: 37,998
HanShi (7/1/2013)
You can use the -U and -P parameters. Take a look at http://msdn.microsoft.com/en-us/library/ms162802.aspx of the complete syntax.


If done correctly (ie, SQL Server is setup with Windows Authentication), you shouldn't have to provide a user name or password. Just use the -E parameter (trusted connection based on the current login), instead.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

Helpful Links:
How to post code problems
How to post performance problems
Post #1469266
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse