SQL Server, T-SQL, ASP.NET, Javascript, SAP, ABAP Programming

Kodyaz Development Resources

Development resources, articles, tutorials, samples, codes and tools for .Net, SQL Server, Vista, etc.
Welcome to Kodyaz Development Resources Sign in | Join | Help




What is new in SQL Server 2008 aka Katmai
Multiple Inserts using the Insert Into Values enhancement in SQL Server 2008


Multiple Inserts using the Insert Into Values enhancement in SQL Server 2008

It is simple but effective to use the new Insert Into syntax if you use insert multiple records into a table in one process using t-sql statements.

Here is a sample for you to try the newly introduced enhancement with SQL2008 in t-sql Insert Into command.

CREATE TABLE MultipleInsertsCities (

CityId int,

CityName nvarchar(25)

)

GO

INSERT INTO MultipleInsertsCities VALUES (1, N'Eskisehir'), (2, N'Istanbul')

SELECT * FROM MultipleInsertsCities

GO

INSERT INTO MultipleInsertsCities (CityId, CityName) VALUES (3, N'New York'), (4, N'Tokyo')

SELECT * FROM MultipleInsertsCities

GO

INSERT INTO MultipleInsertsCities (CityName) VALUES (N'Bangkok'), (N'Lima')

SELECT * FROM MultipleInsertsCities

GO






Related SQL Resources

SQL Server Articles

SQL Server Tools

SQL Blog

SQL Server 2008 Blog

Certification Exams Blog

Reporting Services Blog

Analysis Services Blog

MS SQL Server Forums














Copyright © 2004 - 2010 Eralper Yilmaz. All rights reserved.
Powered by Community Server, by Telligent Systems