How do I create a SQL table under a different schema?

前端 未结 6 1158
天命终不由人
天命终不由人 2020-12-23 19:59

This is from SQL Server 2008, ssms

When I create a table, it creates under dbo.

I would like to create it under a different schema, but when I use the \'New

6条回答
  •  伪装坚强ぢ
    2020-12-23 20:42

                               create a database schema in SQL Server 2008
    1. Navigate to Security > Schemas
    2. Right click on Schemas and select New Schema
    3. Complete the details in the General tab for the new schema. Like, the schema name is "MySchema" and the schema owner is "Admin".
    4. Add users to the schema as required and set their permissions:
    5. Add any extended properties (via the Extended Properties tab)
    6. Click OK.
                               Add a Table to the New Schema "MySchema"
    1. In Object Explorer, right click on the table name and select "Design":
    2. Changing database schema for a table in SQL Server Management Studio
    3. From Design view, press F4 to display the Properties window.
    4. From the Properties window, change the schema to the desired schema:
    5. Close Design View by right clicking the tab and selecting "Close":
    6. Closing Design View
    7. Click "OK" when prompted to save
    8. Your table has now been transferred to the "MySchema" schema.

    Refresh the Object Browser view To confirm the changes
    Done

提交回复
热议问题