{"id":221,"date":"2012-05-18T05:52:27","date_gmt":"2012-05-18T05:52:27","guid":{"rendered":"https:\/\/sqlserverlearner.azurewebsites.net\/2012\/05\/18\/incorrect-syntax-near-the-keyword-into\/"},"modified":"2012-05-18T05:52:27","modified_gmt":"2012-05-18T05:52:27","slug":"incorrect-syntax-near-the-keyword-into","status":"publish","type":"post","link":"https:\/\/sqlserverlearner.com\/2012\/05\/18\/incorrect-syntax-near-the-keyword-into\/","title":{"rendered":"Incorrect syntax near the keyword into"},"content":{"rendered":"

Error Message:<\/strong><\/p>\n


\nMsg 156, Level 15, State 1, Line 2
\nIncorrect syntax near the keyword ‘INTO’.
\n<\/font><\/p>\n

This error occurs when the syntax of the select into statement is not correct.<\/p>\n

Example: <\/strong>
\n[sql]
\nSELECT * FROM
\nProduct INTO ProductBackup
\n[\/sql]<\/p>\n

When the above code is executed error message 156 would occur.<\/p>\n

Fix\/Resolution: <\/strong><\/p>\n

– Check the SELECT INTO syntax.
\n– Make sure that the INTO Statement is after the column list( or *) and before FROM.<\/p>\n

Fixed Code:<\/strong>
\n[sql]
\nSELECT * INTO ProductBackup
\nFROM Product
\n[\/sql]<\/p>\n","protected":false},"excerpt":{"rendered":"

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…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2017,128],"tags":[2018],"_links":{"self":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/221"}],"collection":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/comments?post=221"}],"version-history":[{"count":0,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/posts\/221\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/media?parent=221"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/categories?post=221"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlserverlearner.com\/wp-json\/wp\/v2\/tags?post=221"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}