How can you accomplish this in T-SQL?

You work as a database administrator at ABC.com. ABC.com is using a SQL Server 2008
instance.
Your junior assistant is curious about on how to move a table, such as ABC_table, from its current
scheme (scheme1) to another scheme (scheme2)

How can you accomplish this in T-SQL?

You work as a database administrator at ABC.com. ABC.com is using a SQL Server 2008
instance.
Your junior assistant is curious about on how to move a table, such as ABC_table, from its current
scheme (scheme1) to another scheme (scheme2)

How can you accomplish this in T-SQL?

A.
You should consider using the following:
ALTER TABLE Schema1.ABC_Table SWITCH TO Schema2.ABC_table;

B.
You should consider using the following:
ALTER AUTHORIZATION ON Schema1.ABC_Table TO Schema2;

C.
You should consider using the following:
ALTER SCHEMA schema2 TRANSFER schema1.ABC_table;

D.
You should consider using the following:
ALTER SCHEMA schema1 TRANSFER schema2.ABC_table;

E.
You should consider using the following:
ALTER USER Schema1 WITH DEFAULT_SCHEMA = Schema2;

F.
You should consider using the following:
MOVE ABC_Table FROM SCHEMA schema1 TO schema2

G.
You should consider using the following:
MOVE ABC_Table FROM schema1 TO schema2

Explanation:

ALTER SCHEMA can only be used to move securables between schemas in the same database.
To change or drop a securable within a schema, use the ALTER or DROP statement specific to
that securable.



Leave a Reply 0

Your email address will not be published. Required fields are marked *