Trigger, DTS and parameterized query

  • Hi !

    I want to launch à DTS from a trigger. the sql statement of the DTS must be parameterized by a variable value from the inserted table : in fact, I want to tranfert to a file (txt) a record which is inserted in a table.

    Thank's a lot !

  • Best way is to just use sp_start_job to run your package. Do you really have a requirement to do the export real time?

    Andy

  • I wouldn't run this from a trigger. If you have problems, then the transaction would fail. I'd use the trigger to insert the record into a staging table with a timestamp. Then have your DTS pacakge run every minute or so and check for new records within the last minute. Export these records.

    Steve Jones

    steve@dkranch.net

  • Hi !

    Thank you !

    The trigger fails because the datas aren't posted in the database. I will lauch a DTS package which will run every 10 minutes of fewer.

    I have another question : I want to launch an executable every week end. It moves files for a directory to store them for saving.

    How can i do it with a job ??

    A job accepts only a cmdexec (operating system command) ... Help !!

  • Thank you Andy !

    I am not a specialist of SQL derver and i am only certified with Oracle. I haven't a big experience in SQL server and I do my best to send datas to SAP database via an text file.

    I will export datas every 5 minutes and not in real time !!

  • About your earlier post - you want to want to launch an app from a job using an operating system job? Or you're looking for alternatives?

    Andy

Viewing 6 posts - 1 through 5 (of 5 total)

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