728x90
SMALL
#SQL
#SQL Server/Schema/Create, Browse, Modify, Delete
Schemas
Schemas can be used to classify tables and perform privilege management.
Create schema
Create a schema named a.
create schema a;
Create table
If you create a table without specifying a schema, it will have a dbo schema.
create table client ( id int );
If you specify a schema and create it, the table will be created in that schema.
create table a.client ( id int );
dbo.client and a.client have the same table name, but they are treated as different tables.
Create the schema of a table
Change the schema of a.client to b. In other words, create with b.client.
alter schema b transfer a.client;
Drop the schema
a Drop the schema. If there is a table belonging to a, it will not be deleted.
drop schema a;
728x90
LIST
'SQL server' 카테고리의 다른 글
[SQL] SQL Server / Database / Create, Delete, Modify, Query (0) | 2022.07.29 |
---|