Sproc -inserting data into 2 tables in same sproc

  • I see what you mean. I have usually dealt with single row inserts from a UI. How have you dealt with this issue prior to 2005? That is interesting work.:cool:

    Of course I normally don't do 2 inserts in 1 procedure. Typically I have 2 procedures and the UI/business/data layer calls them in succession with the identity value being returned to the application as an Output paremeter.

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

  • Prior to 2005? Suffered.

    There really wasn't an easy way to do it back then. The best approach was to have a natural key on the table then you wouldn't have to worry about this mess. The next best choice was to have an alternate key on the table so you could query to get the identity value. The worse choice was to have to query for the exact data you just inserted, which didn't always work. Batch processing improved a bunch with 2005.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • Just wanted to thank all you guys for your input (on the output :hehe:). No seriously this has been really interesting to me and I have learnt loads. Thanks also for the prompts replies. Are any of you ASP.Net programmers and know a good forum for ASP.Net topics as I am trained in classic asp and fairly new to ASP.Net but often I don't get any replies at all (although this could be just because my questions are too stupid :-))

  • No, sorry, I'm not an ASP.Net programmer. I'd suggest trying either MSDN or Simple-Talk, just to get started. Other than that, I'm clueless. Sorry.

    ----------------------------------------------------The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood... Theodore RooseveltThe Scary DBAAuthor of: SQL Server 2017 Query Performance Tuning, 5th Edition and SQL Server Execution Plans, 3rd EditionProduct Evangelist for Red Gate Software

  • I do a little ASP.NET, but would not consider myself an expert.

    If you have questions you could do as Grant suggested, try posting here in the Programming\General forum or the Anything That is not about SQL forum, or this forum, http://forums.windowsitpro.com/web/forum/categories.aspx?catid=51&entercat=y which I have used in the past.

    Many of the members here do .NET programming so you may get a response if you post in one of the forums I mentioned.

    Jack Corbett
    Consultant - Straight Path Solutions
    Check out these links on how to get faster and more accurate answers:
    Forum Etiquette: How to post data/code on a forum to get the best help
    Need an Answer? Actually, No ... You Need a Question

  • Shandy (11/26/2008)


    Just wanted to thank all you guys for your input (on the output :hehe:). No seriously this has been really interesting to me and I have learnt loads. Thanks also for the prompts replies. Are any of you ASP.Net programmers and know a good forum for ASP.Net topics as I am trained in classic asp and fairly new to ASP.Net but often I don't get any replies at all (although this could be just because my questions are too stupid :-))

    I've done a fair amount of asp.net programming. I usually use... ASP.NET for my resource. I find that the official MS site has a LOT of good info.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

Viewing 6 posts - 16 through 20 (of 20 total)

You must be logged in to reply to this topic. Login to reply