Create a new table in SQL Server from a query

How can I create a new table from a query in SQL Server.
Is it possible to create a table from a tsql query ? for example

SELECT * INTO NEW_TABLE
FROM
(
select  a,b,c from t1
union
select a,b,c from t2
)
blossomparkAsked:
Who is Participating?
 
Scott PletcherConnect With a Mentor Senior DBACommented:
Yes, just like that.  Of course indexes, constraints (CHECKs, etc.), defaults, and so on are not copied that way, nor would an identity column property: the column would still be an int or other numeric type, but it would no longer be an identity.
0
 
blossomparkAuthor Commented:
Thanks Scott
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.