Link to home
Start Free TrialLog in
Avatar of Shawn
ShawnFlag for Canada

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
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
First you have to create new schema:

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

Avatar of Shawn

ASKER

geesh, yeah. shoulda had a better look. thanks