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
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. Visual Basic
  4. Executing Sql server 2005 Job from vb.net?

Executing Sql server 2005 Job from vb.net?

Scheduled Pinned Locked Moved Visual Basic
csharpdatabasesql-serversysadmin
8 Posts 2 Posters 1 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.
  • M Offline
    M Offline
    montu3377
    wrote on last edited by
    #1

    Hi, Is it possible to execute the sql server 2005 Jobs from vb.net 2005? If Yes than can you tell me how it's possible?any link or any snappet code or any articles by which it describe who idea then it will be good for me. Any alternative way to do that is also acceptable? Basic requirement is to call / execute sql server 2005 Job from vb.net 2005 thanks in adv. montu3377

    D 1 Reply Last reply
    0
    • M montu3377

      Hi, Is it possible to execute the sql server 2005 Jobs from vb.net 2005? If Yes than can you tell me how it's possible?any link or any snappet code or any articles by which it describe who idea then it will be good for me. Any alternative way to do that is also acceptable? Basic requirement is to call / execute sql server 2005 Job from vb.net 2005 thanks in adv. montu3377

      D Offline
      D Offline
      Dave Kreskowiak
      wrote on last edited by
      #2

      It's done the exact same way you execute any SQL statement from VB.NET, like SELECT, UPDATE, INSERT, ... The question comes down to what's the SQL statement you need to execute to launch your job? It'll be exactly the same as if you executed it from the SQL Server console. SqlCommand[^] class docs Dave Kreskowiak Microsoft MVP - Visual Basic -- modified at 12:56 Wednesday 12th July, 2006

      M 3 Replies Last reply
      0
      • D Dave Kreskowiak

        It's done the exact same way you execute any SQL statement from VB.NET, like SELECT, UPDATE, INSERT, ... The question comes down to what's the SQL statement you need to execute to launch your job? It'll be exactly the same as if you executed it from the SQL Server console. SqlCommand[^] class docs Dave Kreskowiak Microsoft MVP - Visual Basic -- modified at 12:56 Wednesday 12th July, 2006

        M Offline
        M Offline
        montu3377
        wrote on last edited by
        #3

        The Job is going to execute ssis Package and that package takes particular .txt file as input and insert those rows from .txt to sql server table.Due to client requirement i can't run that from sql server console directly.I have to execute Job from browser(say asp.net(vb.net code)) and it starts up the job and job execute ssis package and that package will do it's process.

        1 Reply Last reply
        0
        • D Dave Kreskowiak

          It's done the exact same way you execute any SQL statement from VB.NET, like SELECT, UPDATE, INSERT, ... The question comes down to what's the SQL statement you need to execute to launch your job? It'll be exactly the same as if you executed it from the SQL Server console. SqlCommand[^] class docs Dave Kreskowiak Microsoft MVP - Visual Basic -- modified at 12:56 Wednesday 12th July, 2006

          M Offline
          M Offline
          montu3377
          wrote on last edited by
          #4

          The Job is going to execute ssis Package and that package takes particular .txt file as input and insert those rows from .txt to sql server table.Due to client requirement i can't run that from sql server console directly.I have to execute Job from browser(say asp.net(vb.net code)) and it starts up the job and job execute ssis package and that package will do it's process. montu3377

          1 Reply Last reply
          0
          • D Dave Kreskowiak

            It's done the exact same way you execute any SQL statement from VB.NET, like SELECT, UPDATE, INSERT, ... The question comes down to what's the SQL statement you need to execute to launch your job? It'll be exactly the same as if you executed it from the SQL Server console. SqlCommand[^] class docs Dave Kreskowiak Microsoft MVP - Visual Basic -- modified at 12:56 Wednesday 12th July, 2006

            M Offline
            M Offline
            montu3377
            wrote on last edited by
            #5

            The Job is going to execute ssis Package and that package takes particular .txt file as input and insert those rows from .txt to sql server table.Due to client requirement i can't run that from sql server console directly.I have to execute Job from browser(say asp.net(vb.net code)) and it starts up the job and job execute ssis package and that package will do it's process. montu3377

            D 1 Reply Last reply
            0
            • M montu3377

              The Job is going to execute ssis Package and that package takes particular .txt file as input and insert those rows from .txt to sql server table.Due to client requirement i can't run that from sql server console directly.I have to execute Job from browser(say asp.net(vb.net code)) and it starts up the job and job execute ssis package and that package will do it's process. montu3377

              D Offline
              D Offline
              Dave Kreskowiak
              wrote on last edited by
              #6

              You didn't understand what I said. A large part of the SQL specification says that the server must be administerable by the very SQL language that it uses to read and write user databases. IF you were to run the job on from the Server console, what is the SQL command you type to get it to launch your job with all of your parameters, if any?? That's the command you use in the SqlCommand object that's inside your webpage VB.NET code! Other than that command, the rest is just like executing any other SQL query against a database. Dave Kreskowiak Microsoft MVP - Visual Basic

              M 1 Reply Last reply
              0
              • D Dave Kreskowiak

                You didn't understand what I said. A large part of the SQL specification says that the server must be administerable by the very SQL language that it uses to read and write user databases. IF you were to run the job on from the Server console, what is the SQL command you type to get it to launch your job with all of your parameters, if any?? That's the command you use in the SqlCommand object that's inside your webpage VB.NET code! Other than that command, the rest is just like executing any other SQL query against a database. Dave Kreskowiak Microsoft MVP - Visual Basic

                M Offline
                M Offline
                montu3377
                wrote on last edited by
                #7

                Upto now what i understood is like: My asp.net code execute server Console and that server console application execute the Job and then Job will execute package. Is it true?am i misunderstand anything upto here?? Now here regarding passing Sql command object from asp.net code ,i think i have to pass name of the textfile as input.Now answer of read and write user database then that user has full rights to read and write. Do you have any snappet code/articles which describe scenerio?? thanks montu3377

                D 1 Reply Last reply
                0
                • M montu3377

                  Upto now what i understood is like: My asp.net code execute server Console and that server console application execute the Job and then Job will execute package. Is it true?am i misunderstand anything upto here?? Now here regarding passing Sql command object from asp.net code ,i think i have to pass name of the textfile as input.Now answer of read and write user database then that user has full rights to read and write. Do you have any snappet code/articles which describe scenerio?? thanks montu3377

                  D Offline
                  D Offline
                  Dave Kreskowiak
                  wrote on last edited by
                  #8

                  montu3377 wrote:

                  My asp.net code execute server Console and that server console application execute the Job and then Job will execute package.

                  No... How does your application request data from a database? Using a SELECT statement, right? How do you execute a SELECT statement and return a dataset? Same thing, only your not using a SELECT statement, you're using whatever SQL command launches your job on the server!

                  montu3377 wrote:

                  Do you have any snappet code/articles which describe scenerio??

                  Nope. Dave Kreskowiak Microsoft MVP - Visual Basic

                  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