Hi I am trying to create a table using inner select statement...
for example:
CREATE TABLE JmxMonSer AS (SELECT * FROM services WHERE monitoring_enabled = 1);
But keep getting error:
Incorrect Syntax near keyword 'AS', Severity 15
please advice
I'm almost positive that SQL Server doesn't have a CREATE TABLE AS (SELECT... syntax, but you can use SELECT INTO:
SELECT *
INTO JmxMonSer
FROM services
WHERE monitoring_enabled=1
Check the MSDN documentation for proper uses of the CREATE TABLE statement.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With