Skip to content

Contributors ~ Automated Tests

Alessandro Vernet edited this page Mar 27, 2015 · 6 revisions

Home ▸ Contributors

Removing leftover databases on SQL Server

BEGIN
    DECLARE @qry nvarchar(max);
    SELECT @qry = 
        (SELECT 'DROP DATABASE ' + name + '; ' 
         FROM sys.databases 
         WHERE name LIKE 'orbeon_%_tomcat'
         FOR XML PATH(''));
    EXEC sp_executesql @qry;
END;  
Clone this wiki locally