How to transfer a table from one schema to another?



How to transfer a table from one schema to another?..

Answer / Ravi Prakash Srivastava

In SQL Server, you can use the CREATE TABLE AS SELECT (CTAS) statement to create a new table based on the result set of a SELECT query. To transfer a table between schemas, specify the source and destination schema names in the FROM and TO clauses respectively: CREATE TABLE dbo.NewTable (...) AS SELECT * FROM srcdb.oldSchema.OldTable;

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

how can you move the master database

1 Answers   IBM,


What is 2nf example?

1 Answers  


How to loop through returning rows?

1 Answers  


What is left outer join in sql server joins?

1 Answers  


How To delete duplicate record from a particular table?

12 Answers   eXensys, Foxfire,


How to store pdf file in sql server?

1 Answers   CarrizalSoft Technologies, College School Exams Tests, TATA,


What is index in an assignment?

1 Answers  


What is the maximum rows in sql server table?

1 Answers  


Can you index views?

0 Answers  


Once setting replication, can you have distributor on sql server 2005, publisher of sql server 2008?

1 Answers  


What are the different types of sub-queries?

1 Answers  


How do I start sql server?

1 Answers  


Categories