SQL Clone
SQLServerCentral is supported by Redgate
Log in  ::  Register  ::  Not logged in

Command Prompt connectivity –U option

When you try to connect to sql server using isql/osql or sqlcmd there are two authentication you can use windows authentication and sql authentication.

-E option is used for windows authentication where you domain windows login which you have connected to will be used(your windows credential).

Eg. Domainname/loginname

There is other option

-U which uses only SQL authentication you cannot specified here other windows user to works with it should be only sql login and this option should have its passward option

-P to specify sql login password.

if you try to use domain account with -U option you will get error

“msg 18456 level 14 state 1 server”

invalid user name…

If you want to use different windows login you have to run your command prompt with “Run As” option and specified –E which will use the run as authentication.

I was confused on –U option to use Windows authentication as well but its false.

Hope this will clarify someone’s confusion as well.

Thanks for reading.



Leave a comment on the original post [thakurvinay.wordpress.com, opens in a new window]

Loading comments...