Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
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: Monday, June 9, 2014 11:16 PM
Points: 51, Visits: 68
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: Today @ 2:44 PM
Points: 2,309, Visits: 2,790
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: Monday, June 9, 2014 11:16 PM
Points: 51, Visits: 68
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-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Today @ 7:36 AM
Points: 35,218, Visits: 31,677
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."

(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

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

Add to briefcase

Permissions Expand / Collapse