dbTalk Databases Forums  

Dynamic Filename

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


Discuss Dynamic Filename in the microsoft.public.sqlserver.dts forum.



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

Default Dynamic Filename - 06-05-2008 , 11:23 AM






I am trying to build a DTS package that exports data from SQL Server to a
csv file. I am trying to use the Dynamic Properties Task to change the
filename, but it is not working as expected.

I have the Source (SQL Server) transforming to the Text File and the Dynamic
Properties Task is set as follows,

Destination Property: DataSource (of Text file)
Source Type: Query
Source Value: SELECT
'\\Swvtc06\inetpub\intranet\logs\Tracking\Intranet Tracking_' +
CAST(DATEPART(yyyy,GetDate()) as varchar(4)) +
RIGHT('00'+CAST(DATEPART(mm,GetDate()) as varchar(2)),2) +
RIGHT('00'+CAST(DATEPART(dd,GetDate()) as varchar(2)),2) + '.csv'

The problem I am having is that the filename is not being changed as I
expect it to... the query works, it returns the entire string for the
filename.

Thanks,
Drew



Reply With Quote
  #2  
Old   
Drew
 
Posts: n/a

Default Re: Dynamic Filename - 06-05-2008 , 12:27 PM






Figured it out. The query I was using was running against the Text File
(Destination) instead of the SQL Server connection. I changed that and that
fixed it.

Thanks,
Drew

"Drew" <drew.laing (AT) swvtc (DOT) dmhmrsas.virginia.gov> wrote

Quote:
I am trying to build a DTS package that exports data from SQL Server to a
csv file. I am trying to use the Dynamic Properties Task to change the
filename, but it is not working as expected.

I have the Source (SQL Server) transforming to the Text File and the
Dynamic Properties Task is set as follows,

Destination Property: DataSource (of Text file)
Source Type: Query
Source Value: SELECT
'\\Swvtc06\inetpub\intranet\logs\Tracking\Intranet Tracking_' +
CAST(DATEPART(yyyy,GetDate()) as varchar(4)) +
RIGHT('00'+CAST(DATEPART(mm,GetDate()) as varchar(2)),2) +
RIGHT('00'+CAST(DATEPART(dd,GetDate()) as varchar(2)),2) + '.csv'

The problem I am having is that the filename is not being changed as I
expect it to... the query works, it returns the entire string for the
filename.

Thanks,
Drew




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

Default Re: Dynamic Filename - 06-05-2008 , 12:27 PM



Figured it out. The query I was using was running against the Text File
(Destination) instead of the SQL Server connection. I changed that and that
fixed it.

Thanks,
Drew

"Drew" <drew.laing (AT) swvtc (DOT) dmhmrsas.virginia.gov> wrote

Quote:
I am trying to build a DTS package that exports data from SQL Server to a
csv file. I am trying to use the Dynamic Properties Task to change the
filename, but it is not working as expected.

I have the Source (SQL Server) transforming to the Text File and the
Dynamic Properties Task is set as follows,

Destination Property: DataSource (of Text file)
Source Type: Query
Source Value: SELECT
'\\Swvtc06\inetpub\intranet\logs\Tracking\Intranet Tracking_' +
CAST(DATEPART(yyyy,GetDate()) as varchar(4)) +
RIGHT('00'+CAST(DATEPART(mm,GetDate()) as varchar(2)),2) +
RIGHT('00'+CAST(DATEPART(dd,GetDate()) as varchar(2)),2) + '.csv'

The problem I am having is that the filename is not being changed as I
expect it to... the query works, it returns the entire string for the
filename.

Thanks,
Drew




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

Default Re: Dynamic Filename - 06-05-2008 , 12:27 PM



Figured it out. The query I was using was running against the Text File
(Destination) instead of the SQL Server connection. I changed that and that
fixed it.

Thanks,
Drew

"Drew" <drew.laing (AT) swvtc (DOT) dmhmrsas.virginia.gov> wrote

Quote:
I am trying to build a DTS package that exports data from SQL Server to a
csv file. I am trying to use the Dynamic Properties Task to change the
filename, but it is not working as expected.

I have the Source (SQL Server) transforming to the Text File and the
Dynamic Properties Task is set as follows,

Destination Property: DataSource (of Text file)
Source Type: Query
Source Value: SELECT
'\\Swvtc06\inetpub\intranet\logs\Tracking\Intranet Tracking_' +
CAST(DATEPART(yyyy,GetDate()) as varchar(4)) +
RIGHT('00'+CAST(DATEPART(mm,GetDate()) as varchar(2)),2) +
RIGHT('00'+CAST(DATEPART(dd,GetDate()) as varchar(2)),2) + '.csv'

The problem I am having is that the filename is not being changed as I
expect it to... the query works, it returns the entire string for the
filename.

Thanks,
Drew




Reply With Quote
  #5  
Old   
Drew
 
Posts: n/a

Default Re: Dynamic Filename - 06-05-2008 , 12:27 PM



Figured it out. The query I was using was running against the Text File
(Destination) instead of the SQL Server connection. I changed that and that
fixed it.

Thanks,
Drew

"Drew" <drew.laing (AT) swvtc (DOT) dmhmrsas.virginia.gov> wrote

Quote:
I am trying to build a DTS package that exports data from SQL Server to a
csv file. I am trying to use the Dynamic Properties Task to change the
filename, but it is not working as expected.

I have the Source (SQL Server) transforming to the Text File and the
Dynamic Properties Task is set as follows,

Destination Property: DataSource (of Text file)
Source Type: Query
Source Value: SELECT
'\\Swvtc06\inetpub\intranet\logs\Tracking\Intranet Tracking_' +
CAST(DATEPART(yyyy,GetDate()) as varchar(4)) +
RIGHT('00'+CAST(DATEPART(mm,GetDate()) as varchar(2)),2) +
RIGHT('00'+CAST(DATEPART(dd,GetDate()) as varchar(2)),2) + '.csv'

The problem I am having is that the filename is not being changed as I
expect it to... the query works, it returns the entire string for the
filename.

Thanks,
Drew




Reply With Quote
  #6  
Old   
Drew
 
Posts: n/a

Default Re: Dynamic Filename - 06-05-2008 , 12:27 PM



Figured it out. The query I was using was running against the Text File
(Destination) instead of the SQL Server connection. I changed that and that
fixed it.

Thanks,
Drew

"Drew" <drew.laing (AT) swvtc (DOT) dmhmrsas.virginia.gov> wrote

Quote:
I am trying to build a DTS package that exports data from SQL Server to a
csv file. I am trying to use the Dynamic Properties Task to change the
filename, but it is not working as expected.

I have the Source (SQL Server) transforming to the Text File and the
Dynamic Properties Task is set as follows,

Destination Property: DataSource (of Text file)
Source Type: Query
Source Value: SELECT
'\\Swvtc06\inetpub\intranet\logs\Tracking\Intranet Tracking_' +
CAST(DATEPART(yyyy,GetDate()) as varchar(4)) +
RIGHT('00'+CAST(DATEPART(mm,GetDate()) as varchar(2)),2) +
RIGHT('00'+CAST(DATEPART(dd,GetDate()) as varchar(2)),2) + '.csv'

The problem I am having is that the filename is not being changed as I
expect it to... the query works, it returns the entire string for the
filename.

Thanks,
Drew




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

Default Re: Dynamic Filename - 06-05-2008 , 12:27 PM



Figured it out. The query I was using was running against the Text File
(Destination) instead of the SQL Server connection. I changed that and that
fixed it.

Thanks,
Drew

"Drew" <drew.laing (AT) swvtc (DOT) dmhmrsas.virginia.gov> wrote

Quote:
I am trying to build a DTS package that exports data from SQL Server to a
csv file. I am trying to use the Dynamic Properties Task to change the
filename, but it is not working as expected.

I have the Source (SQL Server) transforming to the Text File and the
Dynamic Properties Task is set as follows,

Destination Property: DataSource (of Text file)
Source Type: Query
Source Value: SELECT
'\\Swvtc06\inetpub\intranet\logs\Tracking\Intranet Tracking_' +
CAST(DATEPART(yyyy,GetDate()) as varchar(4)) +
RIGHT('00'+CAST(DATEPART(mm,GetDate()) as varchar(2)),2) +
RIGHT('00'+CAST(DATEPART(dd,GetDate()) as varchar(2)),2) + '.csv'

The problem I am having is that the filename is not being changed as I
expect it to... the query works, it returns the entire string for the
filename.

Thanks,
Drew




Reply With Quote
  #8  
Old   
Drew
 
Posts: n/a

Default Re: Dynamic Filename - 06-05-2008 , 12:27 PM



Figured it out. The query I was using was running against the Text File
(Destination) instead of the SQL Server connection. I changed that and that
fixed it.

Thanks,
Drew

"Drew" <drew.laing (AT) swvtc (DOT) dmhmrsas.virginia.gov> wrote

Quote:
I am trying to build a DTS package that exports data from SQL Server to a
csv file. I am trying to use the Dynamic Properties Task to change the
filename, but it is not working as expected.

I have the Source (SQL Server) transforming to the Text File and the
Dynamic Properties Task is set as follows,

Destination Property: DataSource (of Text file)
Source Type: Query
Source Value: SELECT
'\\Swvtc06\inetpub\intranet\logs\Tracking\Intranet Tracking_' +
CAST(DATEPART(yyyy,GetDate()) as varchar(4)) +
RIGHT('00'+CAST(DATEPART(mm,GetDate()) as varchar(2)),2) +
RIGHT('00'+CAST(DATEPART(dd,GetDate()) as varchar(2)),2) + '.csv'

The problem I am having is that the filename is not being changed as I
expect it to... the query works, it returns the entire string for the
filename.

Thanks,
Drew




Reply With Quote
  #9  
Old   
Drew
 
Posts: n/a

Default Re: Dynamic Filename - 06-05-2008 , 12:27 PM



Figured it out. The query I was using was running against the Text File
(Destination) instead of the SQL Server connection. I changed that and that
fixed it.

Thanks,
Drew

"Drew" <drew.laing (AT) swvtc (DOT) dmhmrsas.virginia.gov> wrote

Quote:
I am trying to build a DTS package that exports data from SQL Server to a
csv file. I am trying to use the Dynamic Properties Task to change the
filename, but it is not working as expected.

I have the Source (SQL Server) transforming to the Text File and the
Dynamic Properties Task is set as follows,

Destination Property: DataSource (of Text file)
Source Type: Query
Source Value: SELECT
'\\Swvtc06\inetpub\intranet\logs\Tracking\Intranet Tracking_' +
CAST(DATEPART(yyyy,GetDate()) as varchar(4)) +
RIGHT('00'+CAST(DATEPART(mm,GetDate()) as varchar(2)),2) +
RIGHT('00'+CAST(DATEPART(dd,GetDate()) as varchar(2)),2) + '.csv'

The problem I am having is that the filename is not being changed as I
expect it to... the query works, it returns the entire string for the
filename.

Thanks,
Drew




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.