select d.name, d.phyname
from sysdevices d, sysusages u
where u.vstart between d.low and d.high
and u.dbid = db_id("sybsystemprocs")
and d.status & 2 = 2
and not exists (select vstart
from sysusages u2
where u2.dbid != u.dbid
and u2.vstart between d.low and d.high)
where:
-
d.name – is
the list of devices to remove from sysdevices.
-
d.phyname – is
the list of files to remove from your computer.
The not exists clause in this query excludes devices that are used by sybsystemprocs and
other databases.
Make a note of the names of the devices to use in subsequent steps.
Warning!
Do
not
remove any device
that is in use by a database other than sybsystemprocs,
or you will destroy that database.