What is the best solution: a long stored procedure or several sql queries?

  •  Hi there!!

    I'm developing a Web application in ASP that uses several MS SQL databases.

    I have to extract information from those different databases. So I wonder if I should do it in a single stored procedure that will last about 10 minutes or in different sql queries from my ASP code??

    Please, let know your opinions!!!

    Thanks in advance!

    Sansan

  • Hi Sansan,

    A little more information would be required before most people in here would cast an opinion.

    Databases on same servers? Tables and structures, information required from each, key values, joins etc, etc.......

    Have fun

    Steve

    We need men who can dream of things that never were.

  • Hello!

    I would say one 'big' would do it ( though maybe that could internally call other SP to get modularization ) so you gain performance in eliminating unneeded server round trips...

    I would just be careful about my transactions though. If your transactions are badly designed and cover the whole sp, maybe your locks might limit your concurrency...

     

    Happy hunting, Hanslindgren!

  • So I have to manage about 100 databases.

    From some ASP pages of my appplication, I have to extract datas from 3 to 5 databases. These databases are chosen regarding the parameters posted in a form by the user.

    So the queries are dynamic. And for some datas, I can do any join. So I have to do it step by step..

Viewing 4 posts - 1 through 3 (of 3 total)

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