SQL Server - Database

Management

Create

  • GUI

_

CREATE DATABASE TestDB
GO

List

SELECT Name from sys.Databases
GO
Name                                                                                                                           
----------
master                                                                                                                         
tempdb                                                                                                                         
model                                                                                                                          
msdb

Use

USE TestDB
GO

Drop

EXEC msdb.dbo.sp_delete_database_backuphistory @database_name = N'yourdbname'
GO

USE [master]
GO
ALTER DATABASE [yourdbname] SET  SINGLE_USER WITH ROLLBACK IMMEDIATE
GO

DROP DATABASE [yourdbname]
GO

Powered by ComboStrap