1: 2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
DECLARE @DBName VARCHAR(60) DECLARE DropDBCur CURSOR FOR SELECT name FROM sys.databases WHERE name like 'PRRS%' OPEN DropDBCur FETCH NEXT FROM DropDBCur INTO @DBName WHILE @@FETCH_STATUS = 0 BEGIN DROP DATABASE @DBName FETCH NEXT FROM DropDBCur INTO @DBName END CLOSE DropDBCur DEALLOCATE DropDBCur