Aashiq Hussain
Aashiq Hussain

Reputation: 583

How to use `sqlcmd` command without username and password in SQL Server 2008?

How can I run commands, passed to sqlcmd, as currently logged on user automatically i.e without having to enter username and password?

I want to use Windows Authentication only. It is a local server.

Upvotes: 18

Views: 28716

Answers (1)

user610217
user610217

Reputation:

sqlcmd takes the -E argument, which means, "Use Trusted Connection"... IOW, your windows credentials.

http://msdn.microsoft.com/en-us/library/ms162773.aspx

Upvotes: 27

Related Questions