dbTalk Databases Forums  

Open File Dialogue within DTS Package?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Open File Dialogue within DTS Package? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
DavidM
 
Posts: n/a

Default Open File Dialogue within DTS Package? - 12-29-2004 , 08:24 AM






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



Reply With Quote
  #2  
Old   
Darren Green
 
Posts: n/a

Default Re: Open File Dialogue within DTS Package? - 12-29-2004 , 11:43 AM






In message <eDBhpHb7EHA.1400 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, DavidM
<spam (AT) spam (DOT) net> writes
Quote:
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

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



Reply With Quote
  #3  
Old   
DavidM
 
Posts: n/a

Default Re: Open File Dialogue within DTS Package? - 12-29-2004 , 02:43 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.



"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote

Quote:
In message <eDBhpHb7EHA.1400 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, DavidM <spam (AT) spam (DOT) net
writes
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


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




Reply With Quote
  #4  
Old   
DavidM
 
Posts: n/a

Default Re: Open File Dialogue within DTS Package? - 12-29-2004 , 03:04 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???



"DavidM" <spam (AT) spam (DOT) net> wrote

Quote:
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.



"Darren Green" <darren.green (AT) reply-to-newsgroup-sqldts (DOT) com> wrote in
message news:tADIWlD0yu0BFw7i (AT) sqldts (DOT) com...
In message <eDBhpHb7EHA.1400 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, DavidM
spam (AT) spam (DOT) net> writes
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


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






Reply With Quote
  #5  
Old   
Darren Green
 
Posts: n/a

Default Re: Open File Dialogue within DTS Package? - 12-30-2004 , 07:50 AM



In message <ezELgme7EHA.3616 (AT) TK2MSFTNGP11 (DOT) phx.gbl>, DavidM
<spam (AT) spam (DOT) net> writes
Quote:
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???

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



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.