Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
Discussion Groups
DB Engine
SQL ServerMSDESQL Server CE
Services
Analysis (Data Mining)Analysis (OLAP)DTSIntegration ServicesNotification ServicesReporting Services
Programming
CLRConnectivitySQLXML
Other Technologies
ClusteringEnglish QueryFull-Text SearchReplicationService Broker
General
Data WarehousingPerformanceSecuritySetupSQL Server ToolsOther SQL Server Topics
DirectoryUser Groups
Related Topics
MS AccessOther DB ProductsMS Server Products.NET DevelopmentVB DevelopmentJava DevelopmentMore Topics ...

SQL Server Forum / DB Engine / SQL Server / May 2008

Tip: Looking for answers? Try searching our database.

how to change schema for a 2005 table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Roger - 30 May 2008 23:18 GMT
a while back I created many tables in a new db, they were created
using the 'management studio' and the schema is 'zinquiry'

today's I created a new table, and its schema is dbo

how can I specify the schema before creating a table
how can I change the schema once the table is created
Plamen Ratchev - 31 May 2008 03:51 GMT
You use ALTER SCHEMA to transfer a table from one schema to another:

ALTER SCHEMA target_schema TRANSFER source_schema.table_name;

To create the table under a specific schema just reference the schema name
when creating the table:

CREATE TABLE Schema.Foo (
keycol INT PRIMARY KEY,
datacol CHAR(1));

HTH,

Plamen Ratchev
http://www.SQLStudio.com
Roger - 31 May 2008 14:37 GMT
> You use ALTER SCHEMA to transfer a table from one schema to another:
>
[quoted text clipped - 10 lines]
>
> Plamen Ratchevhttp://www.SQLStudio.com

cool.. thanx
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2010 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.