Select table name with Schema
SELECT name, [schema] = SCHEMA_NAME(schema_id)
FROM sys.tables
WHERE name = 'orders'
GO
Create new Schema with some name:
create schema new_schema
Now transfer table into new schema:
alter schema new_schema
transfer dbo.Orders
go
SELECT name, [schema] = SCHEMA_NAME(schema_id)
FROM sys.tables
WHERE name = 'orders'
GO
SELECT name, [schema] = SCHEMA_NAME(schema_id)
FROM sys.tables
WHERE name = 'orders'
GO
Create new Schema with some name:
create schema new_schema
Now transfer table into new schema:
alter schema new_schema
transfer dbo.Orders
go
SELECT name, [schema] = SCHEMA_NAME(schema_id)
FROM sys.tables
WHERE name = 'orders'
GO
No comments:
Post a Comment