Reputation: 3521
I know that integrated security is the option to use in a SQL connection string for windows authentication (since we dont have sql authentication), but suppose I want someone else to be able to connect t to the database server (datasource) and database, and I'm giving them the windows account and password used to access the database server (runas different user SSMS)
How can they specify a userid and password while also using integrated security for windows authentication?
Something like this:
Data Source=myServerAddress;Initial Catalog=myDataBase;Integrated Security=SSPI; User ID=UserDomainName\UserName;Password=myPassword;
But from what I read, integrated security ignores the userid/password
Upvotes: 1
Views: 2256
Reputation: 6417
Yeah you can't... that isn't how Integrated Security works.
You can use 'run-as' (hold shift, right-click SSMS icon, select 'run as different user') if you are using a client app like SSMS, or Impersonation if you are doing this in some code you control.
Upvotes: 2