Get SQL Server 2008 Version Numbers from Command-Line, without logging onto DB and where is list... RRS feed

  • Question

  • I've searched and found ways to find the version via SELECT @@version, but that depends on the user having DB login access.  

    We have a task where the only role for this user is to patch/upgrade the OS and DB and that patch-user may very well NOT be able to log into the DB.

    How can one simply get a version number for SQL Server (and components) from the command line without SQLCMD or logging into the database itself.

    There are File Properties dialogs that show the version, and there is the features discovery report which shows the report.  

    But I don't see any command-line tools for this.


    Sunday, March 25, 2012 11:56 PM


All replies

  • Hmm , reading registry by using some .NET application

    Best Regards, Uri Dimant SQL Server MVP http://dimantdatabasesolutions.blogspot.com/ http://sqlblog.com/blogs/uri_dimant/

    Monday, March 26, 2012 8:12 AM
  • Have you tried using vbscripts?

    Check this links Display SQL Server Version Information and Get SQL Server client version on remote server using VBScript

    Fran Lens http://es.linkedin.com/in/franlens
    My Blog: http://www.lensql.net

    Please remember click the Mark as Answer button if a post helps you to solve the problem

    • Marked as answer by PrimeDBA Tuesday, March 27, 2012 2:18 AM
    Monday, March 26, 2012 8:36 AM
  • While that's not precisely the method I shall be employing, I've gone with PowerShell (I think if SQL Server 2k8 (r2 or non r2) is installed, then PowerShell is there, right?)..

    Here's the script I've worked out...

    get-wmiobject win32_product | sort-object name | format-table name, version | findstr /C:"Database Engine Services" | get-unique

    It's much like the scripts you'd linked to.

    Tuesday, March 27, 2012 2:21 AM