Stored Procedure from Application_start

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • geo039
    New Member
    • Nov 2006
    • 47

    #1

    Stored Procedure from Application_start

    Does anyone know how I can execute a stored procedure from application
    start?Seems like it would be an easy answer to find from online
    reading but it's not?!
  • kenobewan
    Recognized Expert Specialist
    • Dec 2006
    • 4871

    #2
    Well I don't know when you'd expect the Application_Sta rt event to fire,
    but I know I don't expect it to happen very often. Under normal release
    conditions it should normally pretty much only fire after you reboot the
    server and someone requests the first page.

    Comment

    • geo039
      New Member
      • Nov 2006
      • 47

      #3
      I guess I'm really confused now. I am a trainee developer at work and am told that I need to update the application's employee table from another table so I have a sp written then i should

      1. set the application variable in the app to today
      2. everytime time i load the app, check if date=today if yes don't run sp, if no run sp

      I thought I needed to fire the sp, set the application date to today then in session start write the logic if date is <> now then run sp

      I don't know seems to me I should just schedule a job in sql server, not even sure why i have to do it the way above.

      Comment

      • kenobewan
        Recognized Expert Specialist
        • Dec 2006
        • 4871

        #4
        Originally posted by geo039
        I guess I'm really confused now. I am a trainee developer at work and am told that I need to update the application's employee table from another table so I have a sp written then i should

        1. set the application variable in the app to today
        2. everytime time i load the app, check if date=today if yes don't run sp, if no run sp

        I thought I needed to fire the sp, set the application date to today then in session start write the logic if date is <> now then run sp

        I don't know seems to me I should just schedule a job in sql server, not even sure why i have to do it the way above.
        Sessions are created in the application, usually initiated in the web config file. However there are events that are available in the global.asax that are better suited to your purpose:
        Working with the ASP.NET Global.asax file

        Comment

        Working...