dbTalk Databases Forums  

Variable text file destination name

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


Discuss Variable text file destination name in the microsoft.public.sqlserver.dts forum.



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

Default Variable text file destination name - 06-16-2004 , 09:55 AM






Hi guru's

I have a DTS package that creates a series of text files
at the end of each month in order to send data dumps to
our customers.

I had hoped to fully automate this process except that I
cannot seem to dynamically change the file name and
destination of the text file!

I currently have set up:
Source:
SQL Server 2000 OLE DB Connection
Get Data:
Transform Data Task executing a stored procedure with a
date passed in as a parameter (this date is stored in a
Package Global Variable which is set using a Dynamic
Properties Task),
Destination:
Text File (Destination) Connection

I have tried setting the Text File (Destination)
Connection properties using the Dynamic Properties Task
but it just fails unless I type in an existing text file
name.

At present I am manually changing the names of the
destination files then having to go into the
Transformation to change the destination there also.

There must be a way of dynamically changing this each
month? I can dynamically change all other types of
destination, so why not text files?

Hope someone out there can help me! I'm pretty good with
SQL & TSQL but nothing like VB so please bear this in mind
when responding.

Many thanks in advance for your help.

Regards

Paula

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Variable text file destination name - 06-16-2004 , 10:07 AM






This article always seems to work for me

How can I change the filename for a text file connection?
(http://www.sqldts.com/default.aspx?200)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Pegasus" <anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Hi guru's

I have a DTS package that creates a series of text files
at the end of each month in order to send data dumps to
our customers.

I had hoped to fully automate this process except that I
cannot seem to dynamically change the file name and
destination of the text file!

I currently have set up:
Source:
SQL Server 2000 OLE DB Connection
Get Data:
Transform Data Task executing a stored procedure with a
date passed in as a parameter (this date is stored in a
Package Global Variable which is set using a Dynamic
Properties Task),
Destination:
Text File (Destination) Connection

I have tried setting the Text File (Destination)
Connection properties using the Dynamic Properties Task
but it just fails unless I type in an existing text file
name.

At present I am manually changing the names of the
destination files then having to go into the
Transformation to change the destination there also.

There must be a way of dynamically changing this each
month? I can dynamically change all other types of
destination, so why not text files?

Hope someone out there can help me! I'm pretty good with
SQL & TSQL but nothing like VB so please bear this in mind
when responding.

Many thanks in advance for your help.

Regards

Paula



Reply With Quote
  #3  
Old   
 
Posts: n/a

Default Re: Variable text file destination name - 06-16-2004 , 10:19 AM



Thanks Allan.
I also found this article and tried to implement it.
Though I don't really do VB Scripts I did manage to
understand this one and think I've updated it for my own
purposes, but now I don't know where to put it in my
DTS. Can you advise me on this?

Also, will I have a problem with the destination on the
Transformation? Previously, when changing the output
destination dynamically to Access or SQL databases I have
had to set the destination in the Transformation to a
constant? Maybe I'm just looking at the whole thing
wrong?

Quote:
-----Original Message-----
This article always seems to work for me

How can I change the filename for a text file connection?
(http://www.sqldts.com/default.aspx?200)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Pegasus" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:1cfed01c453b1$f26923b0$a601280a (AT) phx (DOT) gbl...
Hi guru's

I have a DTS package that creates a series of text files
at the end of each month in order to send data dumps to
our customers.

I had hoped to fully automate this process except that I
cannot seem to dynamically change the file name and
destination of the text file!

I currently have set up:
Source:
SQL Server 2000 OLE DB Connection
Get Data:
Transform Data Task executing a stored procedure
with a
date passed in as a parameter (this date is stored in a
Package Global Variable which is set using a Dynamic
Properties Task),
Destination:
Text File (Destination) Connection

I have tried setting the Text File (Destination)
Connection properties using the Dynamic Properties Task
but it just fails unless I type in an existing text file
name.

At present I am manually changing the names of the
destination files then having to go into the
Transformation to change the destination there also.

There must be a way of dynamically changing this each
month? I can dynamically change all other types of
destination, so why not text files?

Hope someone out there can help me! I'm pretty good
with
SQL & TSQL but nothing like VB so please bear this in
mind
when responding.

Many thanks in advance for your help.

Regards

Paula


.


Reply With Quote
  #4  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Variable text file destination name - 06-16-2004 , 10:33 AM



OK Your package will look like this (it may not but you'll get the idea)

Active Script Task --> On Success --> Source Whatever ---Pump---> Text File


The script will go in the Active Script task.

It will do everything for you.





--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


<anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Thanks Allan.
I also found this article and tried to implement it.
Though I don't really do VB Scripts I did manage to
understand this one and think I've updated it for my own
purposes, but now I don't know where to put it in my
DTS. Can you advise me on this?

Also, will I have a problem with the destination on the
Transformation? Previously, when changing the output
destination dynamically to Access or SQL databases I have
had to set the destination in the Transformation to a
constant? Maybe I'm just looking at the whole thing
wrong?

-----Original Message-----
This article always seems to work for me

How can I change the filename for a text file connection?
(http://www.sqldts.com/default.aspx?200)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Pegasus" <anonymous (AT) discussions (DOT) microsoft.com> wrote in
message
news:1cfed01c453b1$f26923b0$a601280a (AT) phx (DOT) gbl...
Hi guru's

I have a DTS package that creates a series of text files
at the end of each month in order to send data dumps to
our customers.

I had hoped to fully automate this process except that I
cannot seem to dynamically change the file name and
destination of the text file!

I currently have set up:
Source:
SQL Server 2000 OLE DB Connection
Get Data:
Transform Data Task executing a stored procedure
with a
date passed in as a parameter (this date is stored in a
Package Global Variable which is set using a Dynamic
Properties Task),
Destination:
Text File (Destination) Connection

I have tried setting the Text File (Destination)
Connection properties using the Dynamic Properties Task
but it just fails unless I type in an existing text file
name.

At present I am manually changing the names of the
destination files then having to go into the
Transformation to change the destination there also.

There must be a way of dynamically changing this each
month? I can dynamically change all other types of
destination, so why not text files?

Hope someone out there can help me! I'm pretty good
with
SQL & TSQL but nothing like VB so please bear this in
mind
when responding.

Many thanks in advance for your help.

Regards

Paula


.




Reply With Quote
  #5  
Old   
 
Posts: n/a

Default Re: Variable text file destination name - 06-16-2004 , 10:44 AM



Ooh Allan, I could kiss you!!! X

I've always been scared to death of ActiveX VB scripting
but this was a doddle and works excellently!

Thanks for your prompt help! Don't know what I would
have done without you (yes I do - I would have taken 3
hours every month updating DTS destinations!)

Luv

Paula

Quote:
-----Original Message-----
OK Your package will look like this (it may not but
you'll get the idea)

Active Script Task --> On Success --> Source Whatever ---
Pump---> Text File


The script will go in the Active Script task.

It will do everything for you.





--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:1d3f901c453b5$445a6fa0$a101280a (AT) phx (DOT) gbl...
Thanks Allan.
I also found this article and tried to implement it.
Though I don't really do VB Scripts I did manage to
understand this one and think I've updated it for my own
purposes, but now I don't know where to put it in my
DTS. Can you advise me on this?

Also, will I have a problem with the destination on the
Transformation? Previously, when changing the output
destination dynamically to Access or SQL databases I
have
had to set the destination in the Transformation to a
constant? Maybe I'm just looking at the whole thing
wrong?

-----Original Message-----
This article always seems to work for me

How can I change the filename for a text file
connection?
(http://www.sqldts.com/default.aspx?200)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Pegasus" <anonymous (AT) discussions (DOT) microsoft.com> wrote
in
message
news:1cfed01c453b1$f26923b0$a601280a (AT) phx (DOT) gbl...
Hi guru's

I have a DTS package that creates a series of text
files
at the end of each month in order to send data dumps
to
our customers.

I had hoped to fully automate this process except
that I
cannot seem to dynamically change the file name and
destination of the text file!

I currently have set up:
Source:
SQL Server 2000 OLE DB Connection
Get Data:
Transform Data Task executing a stored procedure
with a
date passed in as a parameter (this date is stored
in a
Package Global Variable which is set using a Dynamic
Properties Task),
Destination:
Text File (Destination) Connection

I have tried setting the Text File (Destination)
Connection properties using the Dynamic Properties
Task
but it just fails unless I type in an existing text
file
name.

At present I am manually changing the names of the
destination files then having to go into the
Transformation to change the destination there also.

There must be a way of dynamically changing this each
month? I can dynamically change all other types of
destination, so why not text files?

Hope someone out there can help me! I'm pretty good
with
SQL & TSQL but nothing like VB so please bear this in
mind
when responding.

Many thanks in advance for your help.

Regards

Paula


.



.


Reply With Quote
  #6  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Variable text file destination name - 06-16-2004 , 02:00 PM



Paula.

after the day I've had..................

Glad we could help

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


<anonymous (AT) discussions (DOT) microsoft.com> wrote

Quote:
Ooh Allan, I could kiss you!!! X

I've always been scared to death of ActiveX VB scripting
but this was a doddle and works excellently!

Thanks for your prompt help! Don't know what I would
have done without you (yes I do - I would have taken 3
hours every month updating DTS destinations!)

Luv

Paula

-----Original Message-----
OK Your package will look like this (it may not but
you'll get the idea)

Active Script Task --> On Success --> Source Whatever ---
Pump---> Text File


The script will go in the Active Script task.

It will do everything for you.





--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:1d3f901c453b5$445a6fa0$a101280a (AT) phx (DOT) gbl...
Thanks Allan.
I also found this article and tried to implement it.
Though I don't really do VB Scripts I did manage to
understand this one and think I've updated it for my own
purposes, but now I don't know where to put it in my
DTS. Can you advise me on this?

Also, will I have a problem with the destination on the
Transformation? Previously, when changing the output
destination dynamically to Access or SQL databases I
have
had to set the destination in the Transformation to a
constant? Maybe I'm just looking at the whole thing
wrong?

-----Original Message-----
This article always seems to work for me

How can I change the filename for a text file
connection?
(http://www.sqldts.com/default.aspx?200)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Pegasus" <anonymous (AT) discussions (DOT) microsoft.com> wrote
in
message
news:1cfed01c453b1$f26923b0$a601280a (AT) phx (DOT) gbl...
Hi guru's

I have a DTS package that creates a series of text
files
at the end of each month in order to send data dumps
to
our customers.

I had hoped to fully automate this process except
that I
cannot seem to dynamically change the file name and
destination of the text file!

I currently have set up:
Source:
SQL Server 2000 OLE DB Connection
Get Data:
Transform Data Task executing a stored procedure
with a
date passed in as a parameter (this date is stored
in a
Package Global Variable which is set using a Dynamic
Properties Task),
Destination:
Text File (Destination) Connection

I have tried setting the Text File (Destination)
Connection properties using the Dynamic Properties
Task
but it just fails unless I type in an existing text
file
name.

At present I am manually changing the names of the
destination files then having to go into the
Transformation to change the destination there also.

There must be a way of dynamically changing this each
month? I can dynamically change all other types of
destination, so why not text files?

Hope someone out there can help me! I'm pretty good
with
SQL & TSQL but nothing like VB so please bear this in
mind
when responding.

Many thanks in advance for your help.

Regards

Paula


.



.




Reply With Quote
  #7  
Old   
Tom
 
Posts: n/a

Default Re: Variable text file destination name - 06-16-2004 , 04:07 PM



Alan,

The example on the web site works, but I can't get a dynamic properties method to work. Can you show me an example of this?

Thanks!

Tom

"Allan Mitchell" wrote:

Quote:
This article always seems to work for me

How can I change the filename for a text file connection?
(http://www.sqldts.com/default.aspx?200)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Pegasus" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:1cfed01c453b1$f26923b0$a601280a (AT) phx (DOT) gbl...
Hi guru's

I have a DTS package that creates a series of text files
at the end of each month in order to send data dumps to
our customers.

I had hoped to fully automate this process except that I
cannot seem to dynamically change the file name and
destination of the text file!

I currently have set up:
Source:
SQL Server 2000 OLE DB Connection
Get Data:
Transform Data Task executing a stored procedure with a
date passed in as a parameter (this date is stored in a
Package Global Variable which is set using a Dynamic
Properties Task),
Destination:
Text File (Destination) Connection

I have tried setting the Text File (Destination)
Connection properties using the Dynamic Properties Task
but it just fails unless I type in an existing text file
name.

At present I am manually changing the names of the
destination files then having to go into the
Transformation to change the destination there also.

There must be a way of dynamically changing this each
month? I can dynamically change all other types of
destination, so why not text files?

Hope someone out there can help me! I'm pretty good with
SQL & TSQL but nothing like VB so please bear this in mind
when responding.

Many thanks in advance for your help.

Regards

Paula




Reply With Quote
  #8  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Variable text file destination name - 06-17-2004 , 12:22 AM



How are you sourcing the text file name?
You need to have the DP task execute first in the package.

Let me know the answer to #1 and i can send you a succesful version (will
need eMail address)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Tom" <Tom (AT) discussions (DOT) microsoft.com> wrote

Quote:
Alan,

The example on the web site works, but I can't get a dynamic properties
method to work. Can you show me an example of this?

Thanks!

Tom

"Allan Mitchell" wrote:

This article always seems to work for me

How can I change the filename for a text file connection?
(http://www.sqldts.com/default.aspx?200)

--
--

Allan Mitchell MCSE,MCDBA, (Microsoft SQL Server MVP)
www.SQLDTS.com - The site for all your DTS needs.
I support PASS - the definitive, global community
for SQL Server professionals - http://www.sqlpass.org


"Pegasus" <anonymous (AT) discussions (DOT) microsoft.com> wrote in message
news:1cfed01c453b1$f26923b0$a601280a (AT) phx (DOT) gbl...
Hi guru's

I have a DTS package that creates a series of text files
at the end of each month in order to send data dumps to
our customers.

I had hoped to fully automate this process except that I
cannot seem to dynamically change the file name and
destination of the text file!

I currently have set up:
Source:
SQL Server 2000 OLE DB Connection
Get Data:
Transform Data Task executing a stored procedure with a
date passed in as a parameter (this date is stored in a
Package Global Variable which is set using a Dynamic
Properties Task),
Destination:
Text File (Destination) Connection

I have tried setting the Text File (Destination)
Connection properties using the Dynamic Properties Task
but it just fails unless I type in an existing text file
name.

At present I am manually changing the names of the
destination files then having to go into the
Transformation to change the destination there also.

There must be a way of dynamically changing this each
month? I can dynamically change all other types of
destination, so why not text files?

Hope someone out there can help me! I'm pretty good with
SQL & TSQL but nothing like VB so please bear this in mind
when responding.

Many thanks in advance for your help.

Regards

Paula






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.