Modifying Existing Table Schemas?

By default, I constructed my database using the dbo Schema. I have since created new Schemas, and want to change some of the tables from dbo.

Is there a way to change the existing schema of a table without disrupting the data that is inside the table?

For example:

Current: dbo.Products

Desired Change: NewSchemaName.Products

Thanks.

[370 byte] By [Bibble] at [2007-12-22]
# 1

If this is sql server 2005 you can use the ALTER SCHEMA command as follows

ALTER SCHEMA NewSchemaName TRANSFER dbo.Products

AsvinAnanthanarayanMSFT at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Security...
# 2
Awesome. That was the SQL 2005 command I was looking for. :)
Bibble at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Security...
# 3
Double check on your applications whether they are using schemas as they will definitely fail if you change the schema names.
bass_player at 2007-8-30 > top of Msdn Tech,SQL Server,SQL Server Security...

SQL Server

Site Classified