Msg 156 Level 15 State 1 Line 2 Incorrect syntax near the keyword ‘INTO’ – SQLSERVERLEARNER https://sqlserverlearner.com LEARN SQL SERVER ONLINE Fri, 18 May 2012 05:52:27 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.2 Incorrect syntax near the keyword into https://sqlserverlearner.com/2012/05/18/incorrect-syntax-near-the-keyword-into/ https://sqlserverlearner.com/2012/05/18/incorrect-syntax-near-the-keyword-into/#respond Fri, 18 May 2012 05:52:27 +0000 https://sqlserverlearner.azurewebsites.net/2012/05/18/incorrect-syntax-near-the-keyword-into/ Error Message:


Msg 156, Level 15, State 1, Line 2
Incorrect syntax near the keyword ‘INTO’.

This error occurs when the syntax of the select into statement is not correct.

Example:
[sql]
SELECT * FROM
Product INTO ProductBackup
[/sql]

When the above code is executed error message 156 would occur.

Fix/Resolution:

– Check the SELECT INTO syntax.
– Make sure that the INTO Statement is after the column list( or *) and before FROM.

Fixed Code:
[sql]
SELECT * INTO ProductBackup
FROM Product
[/sql]

]]>
https://sqlserverlearner.com/2012/05/18/incorrect-syntax-near-the-keyword-into/feed/ 0