Is there a way to explicitly specify u / p using windows authentication for ms sql?

Is there a way to explicitly specify a user / domain / password when using Windows authentication for MS SQL?

I mean the connection string.

Edit: I would like to connect to another SQL server with a specific username and password on another computer, so impersonating myself, I don't think this is possible.

+4
source share
2 answers

No, there are no two options in your connection: integrated authentication (current Windows user) and SQL authentication.

If you correctly understood what you are trying to do, log in to SQL Server as another Windows user. You can look at the impersonation of the user (although this should be a separate process, not your main application), or you can look at something like database roles:

MSDN Article

UPDATE Since you stated that you are in a workgroup (I assume both the client and the server), this blog post seems to say that as long as the username and password that you use exactly match the user on the server, you should be OK. Not sure if this is an opportunity, but worth considering. In addition, if any computer is in the domain, the bid is not active - in this case you will have to impersonate for this to happen.

+5
source

No, It is Immpossible. When using Windows Authentication, you are sending the current user ID, and you cannot explicitly specify this. You could change the current flow control.

+2
source

All Articles