Sysdatabaes table and sysobjects table


Sysdatabases table

Sysdatabases is a table in the master databaseread-onlyTable, which contains all the database information


When creating a database, check its existence

use master
 If exists (select * from sysdatabases where name ='Database name ')
 Drop database name
 Create database name


Sysobjects table

Sysobjects is a table in all databases, which records the information of no object created in the database


Create a new table in the database: check whether the table already exists

use student
If exists (select * from sysobjects where condition (contains name and type, table type is' U '))
drop table s
Create tables (fields)