Home Forums SQL Server 2005 Development Create Temporary Tables Dynamically in cursor loop RE: Create Temporary Tables Dynamically in cursor loop

  • I don't think you can do what you're trying to do, and, even if you can, you probably shouldn't.

    A cursor that creates an arbitrary number of temp tables with 1 row each? (If I'm understanding you correctly.) That sounds like the kind of code to use if you want to be rear-ended by a glacier.

    If you really, really must do so, what you might want to do is create one temp table, insert XML data into it for each "sub table", and then use that. Of course, that's asking for an opportunity to be rear-ended by continental drift, but it would do something that might fit what you're asking for.

    Alternately, post something about the end result you're trying to achieve, the code you have for it so far, and we might be able to help you arrive at a better solution.

    - Gus "GSquared", RSVP, OODA, MAP, NMVP, FAQ, SAT, SQL, DNA, RNA, UOI, IOU, AM, PM, AD, BC, BCE, USA, UN, CF, ROFL, LOL, ETC
    Property of The Thread

    "Nobody knows the age of the human race, but everyone agrees it's old enough to know better." - Anon