Hold the output of an SQL statement called by software & release after successful execution of another SQL statement

  • Dear All,

    Hi! I have an online application, which uses ms-sql 2005 database as back-end. In this application lots of Entry forms & reports are there.

    Now my problem is - On load of an Entry Form 2 SQL statements executed (at server end) one by one within 1-2 seconds (One has SQL user defined function & Second has an Stored Procedure). Here, both don't have any dependency and/or relationship on each other.

    Now I need to hold the output of first sql within Sql & after successful execution of second sql re-run the first sql and release the new output to online Application.

    It's not for any type of destructive working. It's for constructive working, as I don't want to make change in Source Code of online application & need to change the output of first sql without changing Sauce Code of application.

    Kindly guide.

  • It's funny how a typo actually summarize the problem... (just look at the last line of the previous post) 😀

    Without changing any code you won't get any change in the way the app works.

    You could insert the result of the sproc into a separate table and modify/query the table after the second sproc. However, you'll need to find a way to determine when the second query actually finished.

    But you need to consider multiple users (concurrency scenario). Maybe it's possible to have any kind of identifier that can be used to match the first and the second sproc.

    The option described above is just a second best (or even less) option. The best advice would be to fix the source code.



    Lutz
    A pessimist is an optimist with experience.

    How to get fast answers to your question[/url]
    How to post performance related questions[/url]
    Links for Tally Table [/url] , Cross Tabs [/url] and Dynamic Cross Tabs [/url], Delimited Split Function[/url]

  • You could add the User defined function in the body of the proc so that the proc executes the UDF as part of its completion. However without knowing the actual reason for why your doing this I cant say if the above approach will even work.

    Jayanth Kurup[/url]

  • What have you done to isolate the problem?

    You ay want to consider providing more information so that someone can help you.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

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

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