![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi all- I'm trying to run a BULK INSERT through an Execute SQL task (I need to call it from Exec SQL to enable triggers). The problem I'm running into is that the import filename is variable. I'm calling the DTS package through a DOS batch file which cycles through a directory and calls DTSRUN for each file. Thus, the filename is passed in from the batch file with the /A switch as a GV. I tried using a third party DLL that allowed me to pass in GVs through ActiveX, but I couldn't get it to work. Basically I have a DTS package with a connection to my SQL server, and an Execute SQL task with the following code: BULK INSERT table FROM @filename WITH (FIRE_TRIGGERS, FORMATFILE='c:\format.fmt') I also tried using the parameters in the Execute SQL Task, but read that you can't use that to pass in a filename. Any help would be greatly appreciated. Thanks! B |
#3
| |||
| |||
|
|
You can build the statement in a piece of Active Script You want the SQLStatement of the ExecuteSQL task Global Variables and SQL statements in DTS (http://www.sqldts.com/default.aspx?205) -- ---------------------------- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Big Brother" <jonasb (AT) alum (DOT) rpi.edu> wrote in message news:79c1dbe1.0401051747.50fb1848 (AT) posting (DOT) google.com... Hi all- I'm trying to run a BULK INSERT through an Execute SQL task (I need to call it from Exec SQL to enable triggers). The problem I'm running into is that the import filename is variable. I'm calling the DTS package through a DOS batch file which cycles through a directory and calls DTSRUN for each file. Thus, the filename is passed in from the batch file with the /A switch as a GV. I tried using a third party DLL that allowed me to pass in GVs through ActiveX, but I couldn't get it to work. Basically I have a DTS package with a connection to my SQL server, and an Execute SQL task with the following code: BULK INSERT table FROM @filename WITH (FIRE_TRIGGERS, FORMATFILE='c:\format.fmt') I also tried using the parameters in the Execute SQL Task, but read that you can't use that to pass in a filename. Any help would be greatly appreciated. Thanks! B |
![]() |
| Thread Tools | |
| Display Modes | |
| |