Return to Snippet

Revision: 31663
at September 10, 2010 05:35 by g8rpal


Initial Code
;WITH Tens AS
(
        SELECT 1 N UNION ALL 
        SELECT 1 UNION ALL 
        SELECT 1 UNION ALL 
        SELECT 1 UNION ALL 
        SELECT 1 UNION ALL 
        SELECT 1 UNION ALL 
        SELECT 1 UNION ALL 
        SELECT 1 UNION ALL 
        SELECT 1 UNION ALL 
        SELECT 1 
)

SELECT ROW_NUMBER() OVER(ORDER BY (SELECT 0)) RN FROM Tens

Initial URL
http://www.sqlservercentral.com/Forums/Topic980975-338-1.aspx

Initial Description

                                

Initial Title
Autogenerate identity column via Select

Initial Tags
function

Initial Language
SQL