Row Constructors in SQL 2008 — Performance Snapshot

Page copy protected against web site content infringement by Copyscape

Let us take a performance snapshot on using Row Constructors in SQL 2008

Example table:

create table Customer
(customerID int primary key clustered identity(1,1)
,firstName varchar(30)
,lastname varchar(30)
, age int
)

— SQL 2005 method

begin transaction
insert into customer values ('Joe', 'Smith', 35)
insert into customer values ('Jane', 'Smith', 36)
insert into customer values ('Daniel', 'Smith', 37)
insert into customer values ('Daniel', 'Smith', 37)
commit transaction;

— SQL 2008 method (row constructors)

begin transaction
insert into customer values
('Joe', 'Smith', 35),
('Jane', 'Smith', 36),
('Daniel', 'Smith', 37),
('John', 'Smith', 38)
commit transaction;

As you examine the different variables, you will notice that SQL 2008 Row constructor method fares much better for the scenario described.