I’m using perl DBI to connect to a SQL Server. This server uses windows authentication. How do I pass on this information to the SQL server via DBI?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I assume that “using Windows authentication” implies that your script runs on Windows. Then there is more than one way to do it. You can use ADO instead of ODBC and don’t need to create a DSN:
output:
If you compare (1) [based on this contribution] and (2), you see that skipping the user info is enough to connect to the database; some drivers/providers may like the addition of “Integrated Security=SSPI”.
Here is a good starting point, if you need help with experimenting with connection strings.