Sign in to follow this  
Followers 0
Alpinestar

SQL Database Version

8 posts in this topic

Hello

I need the ability to query and return the database version of a current SQL 2005 database. Can someone assist / point me in the right path.

Thanks

Share this post


Link to post
Share on other sites



Not sure

was thinking in the lines of OSQL shellexecute. Noticed a _SQL udf but it does not contain the function of database version.

Share this post


Link to post
Share on other sites

Has anyone got any advise please ???

Share this post


Link to post
Share on other sites

#5 ·  Posted (edited)

Hello

I need the ability to query and return the database version of a current SQL 2005 database. Can someone assist / point me in the right path.

Thanks

http://www.sqlite.org/version3.html

more compact format for database files.

$File = FileOpen("database.DB",0)
$FileRead = FileRead($File,15)
MsgBox(0,"",$FileRead);SQLite format 3
Edited by wolf9228

صرح السماء كان هنا

 

Share this post


Link to post
Share on other sites

If the _SQL.au3 file you are reffering to is mine from my signature below then this

Func _ADOVersion($ADODBHandle = -1)
    
    If $ADODBHandle = -1 Then $ADODBHandle = $SQL_LastConnection
    
    If Not IsObj($ADODBHandle) Then
        $SQLErr = "Invalid ADODB.Connection object, use _SQL_Startup()"
        Return SetError($SQL_ERROR, 0, $SQL_ERROR)
    EndIf
    
    Return SetError($SQL_OK,0,$ADODBHandle.Version)
    
EndFunc

Will get you the ADO version

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

SQL information if using the _SQL.au3 from my signature below

Local $aRow
    $iRval = _SQL_QuerySingleRow(-1,"SELECT  @@VERSION",$aRow)
    If $iRval = $SQL_OK then Msgbox(0,"SQL Version", $aRow[0])
Edited by ChrisL

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Thanks ChrisL

That has got me started. However, it is only returning the sql engine information and not the database *build* version. Sorry, might of asked the wrong question at the start of this thread

Looks like this is quite a grey area, as I have been searching on the sql forums with no luck. Will need to check the tables of the database to bring up the right command.

*UPDATE*

OK looking through the database find my stored procedure that gives me the database build version. Using your _SQL_QuerySingleRow function - works a treat with SQL 2005 express. Big Thanks ChisL

Edited by Alpinestar

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0