There is no CREATE TABLE AS(subquery) in SQL Server 2016 syntax. Instead, use SELECT INTO to create a new empty table based on the result set schema:
SELECT *
INTO dbo.djmdev03
FROM dbo.datetable
WHERE 1 = 2;
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
SQL Server 2016. Why is this simple Create Table statement invalid? Seems like it should be straight forward.
IntelliSense says
If this is a required parameter, which one do I choose and why?
There is no CREATE TABLE AS(subquery) in SQL Server 2016 syntax. Instead, use SELECT INTO to create a new empty table based on the result set schema:
SELECT *
INTO dbo.djmdev03
FROM dbo.datetable
WHERE 1 = 2;