all groups > sql server dts > december 2004 >
You're in the

sql server dts

group:

Open File Dialogue within DTS Package?


Open File Dialogue within DTS Package? DavidM
12/29/2004 8:24:48 AM
sql server dts:
Hello, I'm new to DTS and have been learning as much about it as I can. I
have about 20 DTS packages at work that simply reads a .csv file and imports
the data into its own table. The problem is, I'm going to have to change
the path/filename and resave the package each time someone wants to run
it -- unless everyone wants to make sure they have a C:\TEMP\DTS directory
on their PC. Multiple QA folks have to run the DTS package.

My question is this, I've downloaded the Open File Dialogue task from
http://www.sqldts.com/default.aspx?226 and would like to implement within my
DTS package. However, the site does not really give any examples of how to
use it.

My DTS package as a Connection1 (which reads a flat csv file) and a
Connection2 (which writes to SQL Server 2000) and one arrow pointing from
Connection1 to Connection2 that consists of a Transform Data Task.

How do I change the filename on the connection task to use a global variable
(I'm guessing) so I can use the dialogue control? And how to I pass the
global variable to the Transform Data task?

Any help or direction would be appreciated. If I can get this to work, I
think it will save my QA folks from having to go in and modify the package
each time.

....david

Re: Open File Dialogue within DTS Package? DavidM
12/29/2004 2:43:06 PM
Do I need arrow to connect the tasks?

Currently, I have a Dynamic Properties copied and the Open File Dialoge
copied within designer along with my original Connection1 and Connection2.
As I said below, Connection1 and Connection2 are the only ones with the
arrow.



[quoted text, click to view]

Re: Open File Dialogue within DTS Package? DavidM
12/29/2004 3:04:08 PM
Is there a way I can control the order? I'm using the OnSuccess arrow from

DynamicProperies --> Open File Dialogue --> Connection1 ---> Connection2

Everything appears to work. However, I noticed that if I hit "Cancel" on
the Open File Dialogue task, DTS continues to the next step to copy data.
I've tried using OnSuccess, OnFailure, Completion, etc., and it looks like I
cannot stop it from running if the dialogue is closed without selecting a
file???



[quoted text, click to view]

Re: Open File Dialogue within DTS Package? Darren Green
12/29/2004 5:43:16 PM
In message <eDBhpHb7EHA.1400@TK2MSFTNGP11.phx.gbl>, DavidM
<spam@spam.net> writes
[quoted text, click to view]

Use the Dynamic Properties Task to take the global variable value and
assign it to the text file connection.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org
Re: Open File Dialogue within DTS Package? Darren Green
12/30/2004 1:50:40 PM
In message <ezELgme7EHA.3616@TK2MSFTNGP11.phx.gbl>, DavidM
<spam@spam.net> writes
[quoted text, click to view]

Workflow constraints such as On Success are the way to control the order
of execution within a package. You should have the Open File task before
the Dynamic Properties, as the latter uses the variable set by the
former.

If you hit cancel then the variable is not set. If you want this to stop
the execution then you should check that a valid variable value has been
set. I would do this by ensuring the value is blank to start with,
perhaps add an ActiveX Script Task or use some workflow script on the
Open File task itself to set the value to blank. Then have some workflow
script on the Dynamic Properties Task that checks if the variable is
empty, and if so don't execute the task. Have a look at workflow
scripting on the Books Online.


--
Darren Green (SQL Server MVP)
DTS - http://www.sqldts.com

PASS - the definitive, global community for SQL Server professionals
http://www.sqlpass.org
AddThis Social Bookmark Button