• Skanda (10/8/2012)


    Hi,

    not exactly like home work, as per my requirement only am posting.

    i've tried below code, but it is generating only number.

    WITH Sequence ( SeqNo) as

    (

    SELECT 1

    UNION ALL

    SELECT SeqNo + 1

    FROM Sequence

    WHERE SeqNo < 1000

    )

    SELECT TOP 1000 * FROM Sequence

    OPTION ( MAXRECURSION 0);

    GO

    please help me......

    You're looking at the top 1000 in your query, have you thought about how many rows there will actually be?

    You have 36 characters in total for each digit (0,1,2,3,4,5,6,7,8,9,A,B,C,D,E,F,G,H,I,J,K,L,M,N,O,P,Q,R,S,T,U,V,W,X,Y,Z). So we're looking at 36*36*36*36 == 1,679,616 rows.


    Forever trying to learn
    My blog - http://www.cadavre.co.uk/
    For better, quicker answers on T-SQL questions, click on the following...http://www.sqlservercentral.com/articles/Best+Practices/61537/
    For better, quicker answers on SQL Server performance related questions, click on the following...http://www.sqlservercentral.com/articles/SQLServerCentral/66909/