Home Forums SQL Server 7,2000 General do it in database layer or application layer RE: do it in database layer or application layer

  • I have not read the entire thread and I am certainly 'Johnny Come Lately' on this one.  When I read the reply about iterating through the data to be inserted I felt compelled to reply.

     

    You could (Should) simply declare (depending upon the size of the result set) a variable table or a #TEMP table. Smaller sets go with a Variable table no question. Easier to deal with, is not DEALLOCATED, does not use disc access time as it is memory resident.

     

    Anyway Simply feed your complex data as a | delimitated string, or if multiple layers as XML. From there you read this directly into your variable (or temp) table and insert the data, or work with it, in a set based operation rather than looping.

     

     

    <hr noshade size=1 width=250 color=#BBC8E5> Regards,Jeffery Williams http://www.linkedin.com/in/jwilliamsoh