SQL - DROP All Databases on a Server

Updated on 2/7/2015

The following will generate SQL commands to drop all databases on a server. Use with caution.

SELECT 'DROP DATABASE "'+name +'"' from sysdatabases where dbid > 4