how to execute a query before a procedure call in sql server

  • HI,

    Is it possible to execute a query or a statement before the execution of a procedure????

    Means I have web application through which i will access database. There I have procedure before which I have to execute one sql statement

    There are around 3 k procedures where i need to add sql statement if I want to change in my web application....

    Is there any way to execute the sql statement before executing procedure..???

  • I am not confident about understanding what you want done. If you need to execute the same statement to run everytime before the stored procedure runs, why wouldn't you put the statement at the start of the stored procedure instead of changing thousands of invocations??

    Please give more detailed information on what you are asking.

  • Thanks,

    Basically I wanted to run a ad hoc query which contains encryption key for accessing the database objects.

    As my database objects are encrypted, I don't have access to run stored procedure until i decrypt that using encryption key.

    So at the beginning, when .net application establishes connection to sql server at that time I want to execute this ad hoc query to decrypt that particular stored procedure.

    So before running that stored procedure, I need to run that query.

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

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