Microsoft KB Archive/39138

From BetaArchive Wiki

INF: How to Calculate the Virtual Device Number

Q39138



The information in this article applies to:


  • Microsoft SQL Server for OS/2, version 4.2



The following article describes how the virtual device number is calculated and where this information is stored.

Upon execution of the stored procedure SP_HELPDEVICE, one of the fields returned is a virtual device number (V_DEVNO). This number is the virtual device number that was entered when the disk device was created (using DISK INIT).

However, if you examine all of the system tables, there appears to be no table that holds a virtual device number. The number is stored in the LOW column in the SYSDEVICES table in the MASTER database.

Version 4.2 uses the following formula:


    device_number = convert (tinyint,substring(convert
                     (binary(4),sysdevices.low),spt_values.low,1)) 


where spt_values.type = 3


       spt_values.number = 3
       sysdevices.name = "<specific device name>" 

Additional query words: 4.20 4.20a 4.20b

Keywords :
Issue type :
Technology : kbSQLServSearch kbAudDeveloper kbZNotKeyword3 kbSQLServ420OS2


Last Reviewed: January 6, 2000
© 2001 Microsoft Corporation. All rights reserved. Terms of Use.