简体   繁体   English

Microsoft SQL Server错误:“关键字选择附近的语法不正确”

[英]Microsoft SQL Server Error: “Incorrect syntax near keyword Select”

Unsure what syntax the error is referring to at this statement :- 不确定此语句所指的错误语法:

Use MyDatabase
CREATE TABLE TestTable 
    AS (SELECT * FROM dbo.MyTable);

Any help is appreciated! 任何帮助表示赞赏!

The dbo suggests that you are using SQL Server. dbo建议您使用的是SQL Server。 The syntax error is that this syntax is not supported. 语法错误是不支持此语法。

The equivalent syntax in SQL Server is: SQL Server中的等效语法为:

SELECT *
INTO TestTable
FROM dbo.MyTable;

You need to use like below. 您需要使用如下所示。 The one you are using is Oracle syntax. 您正在使用的是Oracle语法。

Use MyDatabase
Go

SELECT * INTO TestTable FROM dbo.MyTable
GO

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SQL Server中关键字“选择”附近的语法不正确 - Incorrect syntax near the keyword 'select' in SQL Server Microsoft SQL Server:关键字“ CASE”附近的语法不正确 - Microsoft SQL Server: Incorrect syntax near the keyword 'CASE' 错误 [42000] [Microsoft][SQL Native Client][SQL Server]关键字“SET”附近的语法不正确 - ERROR [42000] [Microsoft][SQL Native Client][SQL Server]Incorrect syntax near the keyword 'SET' SQL Server为什么关键字'select'附近的语法不正确 - SQL Server why Incorrect syntax near the keyword 'select' SQL Server 2014'关键字'select'附近的语法不正确。 - SQL Server 2014 'Incorrect syntax near the keyword 'select'.' sql max函数错误:关键字“ select”附近的语法不正确 - Error with sql max function: Incorrect syntax near the keyword 'select' SQL关键字“关键字'INNER'附近的语法不正确” - “Incorrect syntax near the keyword 'INNER'” SQL server error 如在SQL Server中一样,在关键字附近获取错误不正确的语法 - getting error incorrect syntax near the keyword as in sql server DELETE中的关键字“INNER”附近的语法错误查询SQL Server错误 - Incorrect syntax near the keyword 'INNER' in DELETE query SQL Server error “关键字‘用户’附近的语法不正确。” SQL 服务器上的错误 - "Incorrect syntax near the keyword 'User'." error on SQL Server
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM