cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Amarjeet
Level 7

Compare string with integer for conditional install.

HI

I am trying to create a condition which will check installed version of SQL 2005 Express edition.

Following registry key has version information in integer form.

SOFTWARE\Microsoft\Microsoft SQL Server\SQLEXPRESS\MSSQLServer\CurrentVersion\Currentversion.

For current version its 9.00.5000.00

Now i want to make sure that new SQL server 2008 R2 ( version - 10.00.1600.1) should not overwrite my previous version.

When i try to compare 10.00.1600 with the version stored in registry it does not work.

I tried SQL2005VER<<"10.00.1600" so that first digit will be compared. But thid does not work as well ( since i am trying to copare a string with integer value in registry)

Any clue ?

Amarjeet

:eek:
Labels (1)
0 Kudos
(1) Reply
rrinblue22
Level 9

Type cast the variable either to string or integer and later perform the comparison on same data type variables
0 Kudos