16.03.2009

SQL Server 2008 new Insert Syntax

use BlogDb
go
if exists(select * from sys.tables where name = 'Tag')
	drop table Tag
go
create table Tag
(
	TagId	int not null identity(1,1) primary key	,
	Name	varchar(255) not null
)	
go
insert into Tag(Name) values('SQL Server 6.0');
insert into Tag(Name) values('SQL Server 6.5');
insert into Tag(Name) values('SQL Server 7.0');
insert into Tag(Name) values('SQL Server 2000');
insert into Tag(Name) values('SQL Server 2005');
insert into Tag(Name) values('SQL Server 2008');
--truncate table 
truncate table Tag
--new Insert Syntax
insert into Tag(Name) values('SQL Server 6.0')
							,('SQL Server 6.5')
							,('SQL Server 7.0')
							,('SQL Server 2000')
							,('SQL Server 2005')
							,('SQL Server 2008')


The traditional insert syntax creates execution plan for each insert, with the SQL Server 2008 optimizer creates one execution plan for the new insert statement.  


NewSyntax 




Hiç yorum yok: