Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Stored Procedure and Jobs

Stored Procedure and Jobs

Scheduled Pinned Locked Moved Database
databasehelpcareer
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pradhip
    wrote on last edited by
    #1

    Can somebody tell me if its possible for a stored procedure to run a job.I have a case where in my user might want to generate the report from the form and then see the output as an excel file.I already have a job that runs the query and spits it out to an excel file. But Now this same query must be done when the user wants. So i want to have a stored procedure that would execute the job whenever the user wants it from the website. Please giveme some links to literature that can help me out. Regards Pradhip.S Why Need Parking lots in Bars when Drunken Driving is Prohibited

    M N 2 Replies Last reply
    0
    • P Pradhip

      Can somebody tell me if its possible for a stored procedure to run a job.I have a case where in my user might want to generate the report from the form and then see the output as an excel file.I already have a job that runs the query and spits it out to an excel file. But Now this same query must be done when the user wants. So i want to have a stored procedure that would execute the job whenever the user wants it from the website. Please giveme some links to literature that can help me out. Regards Pradhip.S Why Need Parking lots in Bars when Drunken Driving is Prohibited

      M Offline
      M Offline
      Mazdak
      wrote on last edited by
      #2

      If your user only want a query they can send a their select statement to mail server of SQL and then wiht sp_processmail stored procedure they will recieve their query,but I don't know about your case.I know very cool site about SQLServer.You can go there and put your question there. www.Sqlteam.com Mazy **"If I go crazy then will you still Call me Superman If I’m alive and well, will you be There holding my hand I’ll keep you by my side with My superhuman might Kryptonite"**Kryptonite-3 Doors Down

      1 Reply Last reply
      0
      • P Pradhip

        Can somebody tell me if its possible for a stored procedure to run a job.I have a case where in my user might want to generate the report from the form and then see the output as an excel file.I already have a job that runs the query and spits it out to an excel file. But Now this same query must be done when the user wants. So i want to have a stored procedure that would execute the job whenever the user wants it from the website. Please giveme some links to literature that can help me out. Regards Pradhip.S Why Need Parking lots in Bars when Drunken Driving is Prohibited

        N Offline
        N Offline
        notadood
        wrote on last edited by
        #3

        sp_start_job [@job_name =] 'job_name' | [@job_id =] job_id [,[@error_flag =] error_flag] [,[@server_name =] 'server_name'] [,[@step_name =] 'step_name'] [,[@output_flag =] output_flag] where [@job_name =] 'job_name' is the name of the job to start. [@job_id =] job_id is the identification number of the job to start. [@error_flag =] error_flag is "reserved" [@server_name =] 'server_name' is the target server on which to start the job. [@step_name =] 'step_name' is the name of the step at which to begin execution of the job and applies only to local jobs. The return code values are 0 (success) or 1 (failure). This example starts a job named Nightly Backup: USE msdb EXEC sp_start_job @job_name = 'Nightly Backup'

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups