Dropping in-memory devices

Use sp_dropdevice to remove in-memory devices. sp_dropdevice removes an in-memory device only if it is currently unused by any database. You must first drop the database, then drop the in-memory device. Dropping an in-memory device deletes its entry from sysdevices and returns the memory to the cache on which it was created, where you can use it for any other purpose, including creating new in-memory devices. This example drops the device named pubs6_device:

sp_dropdevice 'pubs6_device'