问题
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.
Thanks,
回答1:
sqlcmd
takes the -E
argument, which means, "Use Trusted Connection"... IOW, your windows credentials.
http://msdn.microsoft.com/en-us/library/ms162773.aspx
来源:https://stackoverflow.com/questions/15701829/sqlcmd-command-without-username-and-password-in-sql-server-2008