Friday, December 28, 2018

You don't have to have multiple INSERT statements to insert multiple rows in T-SQL.

You may just chase what is in the last set of parentheses after VALUE with another set of parenthesis and then a third set after that and so on. Separate the sets of parentheses with commas like so:

DECLARE @MyStupidNumbers TABLE
(
   Numby INT
)
INSERT INTO @MyStupidNumbers (Numby) VALUES (13), (42), (69), (86)

No comments:

Post a Comment