What is the path of least resistance in getting an SBCL application running on Windows to connect to a SQL Server instance, using integrated authentication?
I have found posts on connecting from CL-SQL to SQL Server using ODBC connections but as far as I can tell, there is no way to this without first manually setting up a DSN.
Is there a simple way to accomplish this?
There is a cl-mssql library that uses FreeTDS to communicate with MSSQL server. According to http://www.freetds.org/userguide/domains.htm, FreeTDS will use Integrated Authentication if you specify the login like 'DOMAIN\Username'. So it might work with cl-mssql (though I haven't used it).
The path of least resistance for this (SBCL, Windows, no-DSN) seems to be plain-odbc.
(asdf:load-system :plain-odbc)
(use-package :plain-odbc)
(setf conn (connect-generic :driver "{SQL Server}"
:database "dbname"
:server "servername"
:trusted_connection "yes"))
(exec-query conn "select * from some_table")
Don't use (connect-sql-server ...) as it requires a default DSN, *default-sql-server-dsn*.
There may be a better driver to specify, as well.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With