How do I connect with Perl to SQL Server?

前端 未结 2 1262
南旧
南旧 2021-02-01 09:49

I have a user id, password, database name and datasource details. I want to connect with Perl to a MSSQL server. I just used the following snippet, but I am getting an error.

2条回答
  •  自闭症患者
    2021-02-01 10:32

    Everything following 'dbi:ODBC:' in your connection string is passed to the ODBC driver. For MSSQL, try this connection string:

    DBI->connect("dbi:ODBC:Driver={SQL Server};Server=192.168.3.137;UID=$user;PWD=$password")
    

    You can find some more alternatives on connectionstrings.com

提交回复
热议问题