Monday, January 9, 2012

Insert tid bits from SQL Pass 2011


Found this useful bit of tip from SQL Pass 2011 presentation.

create table dbo.numbers
(
Numbers int primary key
);

SELECT TOP(1000) RN = ROW_NUMBER() OVER
(ORDER BY c1.[object_id])
FROM sys.columns c1
cross join sys.columns AS c2
cross join sys.columns as c3
order by c1.[object_id]


No comments: