Results 1 to 4 of 4

Thread: Trigger and Package

  1. #1
    Join Date
    Aug 2003
    Posts
    15

    Trigger and Package

    Hey Guys!

    A quick question. I need to call a package from a trigger. The need being, I want to get the result set of a query, do some manipulation on it and generate a text file in custom format. This process needs to be triggered from the table rather than being a scheduled process. Is there a way I can call an sql package from a trigger???

    Ketan

  2. #2
    Join Date
    Sep 2002
    Posts
    5,938
    Can try call dtsrun with xp_cmdshell or create job for the package and run the job with msdb..sp_start_job.

  3. #3
    Join Date
    Nov 2002
    Location
    New Jersey, USA
    Posts
    3,932
    What do you mean by a package?. Is it a script file or a DTS package?

    For both cases you will have to open command shell using xp_cmdshell. If it is a script file then run osql.exe for dts run dtsrun.exe

  4. #4
    Join Date
    Sep 2002
    Location
    Fantasy
    Posts
    4,254
    you can use sp_oamethod to call a procedure if you are not comfortable in using xp_cmdshell.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •