These StackOverflow questions here, here, and here all say the same thing, but I can't get it to run in SSMS or SQLFiddle
<!-- language: lang-sql -->CREATE TABLE #Names
(
Name1 VARCHAR(100),
Name2 VARCHAR(100)
)
INSERT INTO #Names
(Name1, Name2)
VALUES
('Matt', 'Matthew'),
('Matt', 'Marshal'),
('Matt', 'Mattison')
When I execute this is SSMS, the insert fails with the following message on the first line after VALUES
Msg 102, Level 15, State 1, Line 10
Incorrect syntax near ','.
This Fiddle runs without the #
sign, and the schema executes successfully when the table name is #Names
, but I get the following message when I try to select * from the table
Invalid object name '#NAMES'.: SELECT * FROM #NAMES
Does SQL Server 2012 support multiple inserts?
Update: Apparently accessing a 2005 server on SSMS 2012....
<!-- language: lang-sql -->SELECT @@VERSION --Returns: Microsoft SQL Server 2005