Server Checks - Sql 2008

Server Checks - Sql 2008

by seth washeck -
Number of replies: 6

we're installing moodle on a win 2k8 box with iis7 and php through fastcgi and looking at migrating from postgres to mssql.  we want to run sql 08.

there are a few problems - i cannot get freetds to work.  i've scoured the boards and i keep getting an error that states that my php is improperly configured to connect with mssql.  yes, extension=php_mssql.dll is commented out.

because i've had no bad experiences running php and iis through odbc i tried that route and got further but now it's telling me in the "server check" that i dont have the correct version

Name Information Report Status
database mssql docs.gifversion 9.0 is required and you are running Check

i know everyone says to not change any of the install scripts but where is this check performed?  i'd like to alter it so that i can run version 10

Average of ratings: -
In reply to seth washeck

Re: Server Checks - Sql 2008

by Richard Enison -
SW,

You don't need to alter anything to get it to accept version 10. Version 9.0 is required means you need at least 9.0. Any version higher than 9.0 is acceptable. The problem is that Moodle is not recognizing the version of MSSQL that you have as 10. It is not saying, "version 9.0 is required and you are running 10.0." It is saying, "version 9.0 is required and you are running ." It thinks your version number is blank, which is to say 0, which is not higher than 9.0. I don't know offhand why it is not recognizing your MSSQL version, but that is your problem.

RLE
In reply to Richard Enison

Re: Server Checks - Sql 2008

by seth washeck -
are there any ideas as to where i should look to make this return a version? data source?
In reply to seth washeck

Re: Server Checks - Sql 2008

by Richard Enison -
SW,

Data source? No problem! Here it is:

Moodle gets the version of a MSSQL database, in a method called ServerInfo, in lib/adodb/drivers/adodb-mssql.inc.php. What it does is it executes the following query:

execute sp_server_info 2

Then it uses the description column in the row it gets as the version. If that column is blank or non-existent, then MSSQL 2008 is being inconsistent with previous versions.

I don't have MSSQL on my PC, I have (almost) never used it, and I know very little about it. But you have it, so if you can find out what query to use to get the version number, let us know, and I'll give you instructions on editing ServerInfo.

RLE
In reply to Richard Enison

Re: Server Checks - Sql 2008

by seth washeck -
excellent ... thank you.
perhaps a suggestion would be to run the sp_server_info sproc with the 500 argument. that simply returns a version number. the is variance between 2000 and 2005


Sql 2000: Microsoft SQL Server 2000 - 8.00.2039 (Intel X86) May 3 2005 23:18:38 Copyright (c) 1988-2003 Microsoft Corporation Standard Edition on Windows NT 5.2 (Build 3790: Service Pack 1)

Sql 2005: Microsoft SQL Server Yukon - 9.00.3042

Sql 2008: Microsoft SQL Server Yukon - 10.0.1600

whereas sp_server_info yields

Sql 2000: 8.00.2039
Sql 2005: 9.00.3042
Sql 2008: 10.0.1600

ServerInfo gets the result, calls ADOConnection::_findvers which I found in lib/adodb/adodb.inc.php and is a RegEx search which, theoretically, seems as though it should find 10.0.1600.


In reply to seth washeck

Re: Server Checks - Sql 2008

by Richard Enison -
SW,

You're right. The question is whether it is passing the right info to _findvers.

And I was mistaken when I said what it passes is the description column of the result of the execute query. Actually, it creates an array with a description key, whose value is the third element of the array it gets from the query ($row[2]), and that value is what is passed to _findvers. To find out what exactly is going on, you could temporarily put these statements into ServerInfo, right after the line where _findvers is called (and before the return statement at the end).

// temporary debug dumps to be removed asap
?>
<br />
<pre>
<?php
print_r ($row);
print_r ($arr);
?>
</pre>
<?php
// end of temporary dumps

These will hopefully display the values of all elements of both arrays, starting on a new line, on the page where the server check you showed before is, probably right after (or maybe before) that server check line.

Needless to say, I haven't tested this, since I don't have MSSQL. But if it messes things up, you can always remove these 11 lines. You seem to understand PHP well enough to know that there is nothing in these lines that changes the value of a variable, writes to the database, or to any file, so no permanent damage should occur. But if you want to back everything up first, I won't complain!

RLE
In reply to Richard Enison

Re: Server Checks - Sql 2008

by Cu Culain -
Hi I am running this on a test environment using the ODBC connector. All my checks are fine bar the database check for which is get the same error as above (version 9.0 is required and you are running).

Is there any way to bypass this check?