-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path02-DELETE_Drop.sql
More file actions
32 lines (22 loc) · 864 Bytes
/
02-DELETE_Drop.sql
File metadata and controls
32 lines (22 loc) · 864 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
/*
DELETE Or Dropping a database
To delete or drop a database
Drop database Database_That_you_want_to_Drop
Dropping a database, delete the LDF and MDF files
you cannot drop a database, if it is currently in use. You get an error stating _
Cannot drop database
"NewDatabaseName" Because it is currently in use
so if other users are connected, you need to put the dataabase in single user mode
and then drop the database
Alter Database dataBaseName Set SINGLE_USER wiht Rollback immediate
With Roolback immediate option, will rollback all incomplete transactions and closes
the connection to the database
Note System database cannot be dropped
*/
/*
DELETE Or Dropping a database
To delete or drop a database
Drop database Database_That_you_want_to_Drop
*/
create database new_database
drop database new_database