This magic code will create a sequence of numbers that can be used like a primary key without having to use a table's IDENITITY column.
SELECT ROW_NUMBER() OVER (ORDER BY col1) AS rn, * FROM tbl1
Tuesday, June 7, 2011
Subscribe to:
Posts (Atom)