"Create Table as" clause issue

Highlighted
Occasional Visitor

Hey all there, I am trying to create a new table in MSSQL Server 2017 from two other existing tables. 

Currently, i am using "Create table as" clause but unfortunately it brings syntax error as in below screenshot attached.

But, interestingly, same task is accomplished by using "Select INTO" clause.So my question is that

"Create Table AS" is valid in MSSQL Server or not ? 

2 Replies
Highlighted

@AfrazKhan you can use SELECT INTO command

Highlighted

Hello,

 

   I think, "Create table as" clause is not supported by SQL Server but Azure SQL Data Warehouse is supporting this clause.

 

you should see the link as follows

https://docs.microsoft.com/en-us/sql/t-sql/statements/create-table-as-select-azure-sql-data-warehous...

 

Good days,

 

@AfrazKhan