30 March,2022 by Tom Collins
Question: When the sqlcmd utility connects to a SQL Server ,what connection provider is used to interface with SQL Server ?
Answer: SQLCMD uses OLEDB as client interface. You can verify by checking the sys.dm_exec_sessions DMV
select * from sys.dm_exec_sessions where session_id > 50
You'll notice when the program = SQLCMD the client_interface_name = ODBC . When the program = Microsoft SQL Server Management Studio the client_interface_name = .Net SqlClient Data Provider
Why is this important ?
There are differences between ODBC and .Net Sql Client Data Provider .
1) SSMS uses the .Net SQLClient provider versus SQLCMD which executes across an ODBC provider . If you are troubleshooting a performance issue - it is a consideration in how you are testing code .
Read more on using sqlcmd
How to capture errors from SQLCMD
How to use a blank password with SQLCMD
This is only a preview. Your comment has not yet been posted.
As a final step before posting your comment, enter the letters and numbers you see in the image below. This prevents automated programs from posting comments.
Having trouble reading this image? View an alternate.
Posted by: |