First OptionSyntax works in SQL Server 2008 (but not in SQL Server 2005)CREATE TABLE MyTable (id int, name char(10)); INSERT INTO MyTable (id, name) VALUES (1, 'Bob'), (2, 'Peter'), (3, 'Joe'); SELECT * FROM MyTable; id | name ---+--------- 1 | Bob 2 | Peter 3 | Joe
Second Option
INSERT INTO dbo.MyTable (ID, Name) select * from ( select 123, 'Timmy' union all select 124, 'Jonny' union all select 125, 'Sally' ...
) x
No comments:
Post a Comment