• sarafpradeep (10/14/2013)


    Thanks to all, I got this solved. I have assigned a GUID to the temp table name and built/select/drop it dynamically. I have tested it and it is working perfect.

    Once again thanks everyone.

    That's still a lot of overkill. Read about the partitioned views I told you about. Also, if you've gone to a GUID name for a Global Temp table to try to overcome the "problems" of using dynamic SQL, then you're asking for trouble in the future.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)