Reputation: 583
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
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