HiveBrain v1.2.0
Get Started
← Back to all entries
patterncsharpModerate

Login to SQL Server using Windows Authentication

Submitted by: @import:stackexchange-dba··
0
Viewed 0 times
sqlloginauthenticationusingwindowsserver

Problem

I have an (.Net Console App) EXE which connects to various SQL databases using SQL server Authentication with appropriate credentials.
Now there is change required in the EXE to use windows authentication and use the Network Credentials to log in SQL server. (All SQL servers are on diffrent locations)
I have the network credentials with me, but am confused how to connect to remote SQL server using these and retrive data from that.
Please help.

Solution

The only change required is in the connection string: remove the User ID=...; and Password=...;, and add Integrated Security=SSPI; instead.

More information can be found here.

Context

StackExchange Database Administrators Q#12453, answer score: 11

Revisions (0)

No revisions yet.