Quantcast
Channel: SQL Errors – SQLSERVERLEARNER
Viewing all articles
Browse latest Browse all 74

Incorrect syntax near the keyword into

$
0
0

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]


Viewing all articles
Browse latest Browse all 74

Trending Articles