• ChrisM@Work (10/31/2012)


    sqldba_newbie (10/31/2012)


    ChrisM@Work (10/31/2012)


    sqldba_newbie (10/28/2012)


    my bad...i have updated the code now...thanks

    Where? Without knowing how #sid is populated, it's impossible to do what you are asking.

    CREATE TABLE #Sid

    (

    ID INT

    )

    SET @i = 1

    WHILE @i <= 8000

    BEGIN

    INSERT INTO #Sid

    VALUES (@i)

    SET @i = @i + 1

    END

    It is also in the code.

    It isn't in the code you've posted, in the opening post of this thread. I recommend you post the whole batch again in a new post, in case there's anything else you have missed out, which you can see but we can't.

    I suspect that what you are trying to do isn't particularly challenging. What's challenging for us is trying to figure out the problem, not the solution.

    It was edited in the quote in the first response back to you. That is exactly why I reposted it because changing the code inside a quote gets totally lost.

    What's challenging for us is trying to figure out the problem, not the solution.

    +100 😀

    _______________________________________________________________

    Need help? Help us help you.

    Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.

    Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.

    Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
    Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
    Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
    Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/