The commands to create a procedure called sp_vdevno, which finds the virtual device number of a given device, are shown below.
sp_vdevno returns results similar to the following:
1> sp_vdevno 2> go
vdevno       name         status
----------   ---–-------  ------
         0   master            2
         4   user_disk4        3
WARNING! The sp_vdevno stored procedure is provided for your information-it is not supported at this time.
The sp_helpdevice stored procedure reports similar information.