I am using SQL Server. I am trying to figure out how to insert multiple rows with a single query.
In MySQL, the query will look like this:
the code:
INSERT INTO Mytable (Name, Number) VALUES ('Joe', 18), ('Bob', 25), ('Mike', 7);
I tried a query like the one above in SQL Server and it gave me an error message:
Invalid syntax next to ','.
Is there a way to do this in SQL Server?
source
share