Bug in SQL2000 Database Collection

May 20, 2009 at 8:36 AM

I think I have spotted a bug in the SQLH2 Collector Database phase when connecting to a SQL 2000 instance. Versions 2.1.003 and 2.1.004 do not appear to return any SQL 2000 database information to the repository.

I am a humble DBA/Designer and not a C# programmer at all, but I noticed the following in code 19792. I think it is also in 23414.

In Collector_SQL.cs in UnitCollectDatabase there is a condition Case H2ProductLevel.PreSQL2000SP3 and this runs CollectDatabases2000(). Since PreSQL2000SP3 is not supported, I think this should read instead Case H2ProductLevel.SQL2000SP3 which will fire the collection for the supported level of SQL 2000.

Could this fix be incorporated in the next release?

Jul 29, 2009 at 12:30 AM

Hey there, I am a DBA as well and is interested in getting more information about the condition case you have mentioned above.

Just a couple of questions:

1. Did you actually manage to change code to use H2ProductLevel.SQL2000SP3 and did it work okay?

2. and if you dont mind, how and where can I change these code if want to?

 

Appreciate your response.

Jul 30, 2009 at 9:28 AM

Daylinda, I did change the code and it is working OK.

Here are the steps I took:

  1. Download the source code from Codeplex, in my case build 19792.
  2. Under sqlh2-19792 there is a H2.sln file which is a Visual Studio Solution file. Double click this to open it in Visual Studio.
  3. In Solution explorer identify Collector_SQL.cs and double-click it
  4. Do a search for UnitCollectDatabase  -  about line 228 there is the void that starts the routine
  5. In here is a case structure around line 240 that tests for H2ProductLevel.PreSQL2000SP3 and then calls CollectDatabases2000

case H2ProductLevel.PreSQL2000SP3:

CollectDatabases2000 ();

break;

  • I added a new line to test for SP3 in between so I ended up with

case H2ProductLevel.PreSQL2000SP3:

case H2ProductLevel.SQL2000SP3:

CollectDatabases2000 ();

break;

 

Hope this helps

Jul 31, 2009 at 3:28 AM

Hey, it works perfectly...

Thanks a lot!

Sep 14, 2009 at 10:20 AM
ubersquirrel wrote:

Daylinda, I did change the code and it is working OK.

Here are the steps I took:

  1. Download the source code from Codeplex, in my case build 19792.
  2. Under sqlh2-19792 there is a H2.sln file which is a Visual Studio Solution file. Double click this to open it in Visual Studio.
  3. In Solution explorer identify Collector_SQL.cs and double-click it
  4. Do a search for UnitCollectDatabase  -  about line 228 there is the void that starts the routine
  5. In here is a case structure around line 240 that tests for H2ProductLevel.PreSQL2000SP3 and then calls CollectDatabases2000

case H2ProductLevel.PreSQL2000SP3:

CollectDatabases2000 ();

break;

  • I added a new line to test for SP3 in between so I ended up with

case H2ProductLevel.PreSQL2000SP3:

case H2ProductLevel.SQL2000SP3:

CollectDatabases2000 ();

break;

 

Hope this helps

 Hi,

I just realized the latest SQLH2 version doesn't collect SQL 2000 database information. Bummer. You say you've solved that problem. I've tried your solution but can't get it to work. Do you have a copy of your EXE file or something you can send me?

Regards,
Einar.

Sep 14, 2009 at 12:29 PM

Never mind. I figured it out. Was a case of UPPER and lower case in the code.  :)

By the way, when collecting OS information I seem to get errors when I encounder Windows Server 2003 R2. Has anyone any idea where I could fix that?

Status: Opening Unit 1 (OS/CS)

Status: Collecting Win32_OperatingSystem

Status: Closing Unit 1

ERROR: Input string was not in a correct format.

WARNING: WMI Collector encountered critical error. Abandoning Collector.