0

I get this error when running the following code. What am I doing wrong? I want to add multiple values to the Column Code1. Column Code2 needs to be empty for now.

CREATE TABLE #Temp2
(Code1 VARCHAR(30), Code2 VARCHAR(30))

INSERT INTO tempdb.dbo.#Temp2
(Code1)
VALUES ('123') ,('234');

The following error I am getting:

Msg 103010, Level 16, State 1, Line 1
Parse error at line: 6, column: 16: Incorrect syntax near ','.
Tim
  • 10,459
  • 4
  • 36
  • 47
Clyde
  • 11
  • 2
  • 1
    Your issue cannot be reproduced either on [SQL Server 2014](http://rextester.com/HFDTM5104) nor 2017 on my local instance. Which SQL Server version are you running? – Rigerta Jul 17 '18 at 07:53
  • SELECT @@version gives: Microsoft Parallel Data Warehouse - 10.0.8727.0 (X64) May 8 2018 15:51:34 Copyright (c) Microsoft Corporation Parallel Data Warehouse (64-bit) on Windows NT 6.2 (Build 9200: ) – Clyde Jul 17 '18 at 07:56
  • It can work in http://sqlfiddle.com/#!18/4efcf/1 – D-Shih Jul 17 '18 at 08:01

1 Answers1

0

Try this:

INSERT INTO Table ( Column1, Column2 ) VALUES ( Value1, Value2 ), ( Value1, Value2 )
Quiron
  • 340
  • 2
  • 12