Shawn
asked on
Change schema name on Tables
I am just beginning the use of schemas and need to know how to hange schema name on Tables in sql 2005 with Management Studio.
how would I change this for example:
dbo.tblCandidatures to newschema.tblCandidatures
how would I change this for example:
dbo.tblCandidatures to newschema.tblCandidatures
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
geesh, yeah. shoulda had a better look. thanks
CREATE SCHEMA [newschema] AUTHORIZATION [dbo]
(The AUTHORISATION part you should change to appropriate user, dbo was used because it exists in almost all databases)
Then you may create tables in this new schema:
SELECT * INTO newschema.tblCandidatures FROM dbo.tblCandidatures
and drop the original table from dbo:
DROP TABLE dbo.tblCandidatures