Search code examples
sql-serverpowershellodbc

How to find out SQL Server ODBC driver version using code?


I need to find a way to get the SQL Server ODBC driver version info using code, preferably PowerShell. Is there an easy way to achieve this?

I checked registry, It is not available in registry. If not in registry, any workaround will also do. Thank you so much.

enter image description here


Solution

  • This driver is a Windows component, so you can just check that:

    [System.Environment]::OSVersion.Version

    enter image description here

    Or check it like this

    PS C:\Users\david> (Get-Item C:\Windows\System32\sqlsrv32.dll).VersionInfo.FileVersionRaw
    
    Major  Minor  Build  Revision
    -----  -----  -----  --------
    10     0      26100  2033