INF: How to Calculate the Virtual Device Number

Last reviewed: March 12, 1997
Article ID: Q39138

The information in this article applies to:
  • Microsoft SQL Server versions 4.2x for OS/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 : SSrvAdmin
Version : 4.20
Issue type : kbtshoot


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: March 12, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.