To create the SQL statement for the database:
1 UsePractice2 Go 3 if exists(Select * fromsysobjectswhereName='Practice')4 Drop Tablestore_information5 Create Tablestore_information6 (7StoreIDint Identity(1,1)Primary Key,--Column Properties "Identity (start value, increment amount)"8Store_namevarchar not NULL,9Store_moneydecimal NULL,TenStore_date Date not NULL, One)
To delete a database, SQL Server stores the inventory of the database in the sysdatabases table of the Master System database, just to see if the table exists in the database.
, with the following statement:
1 Use -- set the current database to master for access to the sysdatabases table 2 Go 3 if exists (Select*fromwhere name='practice ' )4dropdatabase Practice
The SQL statement that creates the table is as follows:
1 UsePractice2 Go 3 if exists(Select * fromsysobjectswhereName='Practice')4 Drop Tablestore_information5 Create Tablestore_information6 (7StoreIDint Identity(1,1)Primary Key,--Column Properties "Identity (start value, increment amount)"8Store_namevarchar not NULL,9Store_moneydecimal NULL,TenStore_date Date not NULL, One)
SQL statements create tables and databases