About

Martin Klier

usn-it.de

CREATE TABLE AS SELECT (CTAS) in MS SQL Server

In Oracle often we are using

CREATE TABLE TABLE_B AS SELECT * FROM TABLE_A;

But in SQL Server, this syntax does not work. Use

SELECT * INTO TABLE_B FROM TABLE_A;
COMMIT;

instead.

Hope this helps
Martin

Oracle Performance Firefighting with Craig Shallahamer (Frankfurt, April 2011)
How to find out the (biggest) table size in MS SQL Server?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.