dbTalk Databases Forums  

Dynamic excel file name for DTS export

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


Discuss Dynamic excel file name for DTS export in the microsoft.public.sqlserver.dts forum.



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

Default Dynamic excel file name for DTS export - 06-02-2005 , 11:11 AM







Hello everyone,

I am facing a situation, and your help would be really appreciated.

I have created a view in SQL server that I need to export to an excel
file on a monthly basis. However, what I want to do is give the exported
file a dynamic name with a date or some other identifier in the end.

I was thinking something along the lines of "FileName_060205" if it is
run on 6/2/2005 and "FileName_070205" if is run on 7/2/2005

Is anybody aware of a way to do this.

Thanks for your help.


*** Sent via Developersdex http://www.developersdex.com ***

Reply With Quote
  #2  
Old   
Helge C. Rutz
 
Posts: n/a

Default Re: Dynamic excel file name for DTS export - 06-02-2005 , 11:49 AM






Hi Sameer,

"Sameer Parekh" wrote:
Quote:
Hello everyone,
I am facing a situation, and your help would be really appreciated.
I have created a view in SQL server that I need to export to an excel
file on a monthly basis. However, what I want to do is give the exported
file a dynamic name with a date or some other identifier in the end.
I was thinking something along the lines of "FileName_060205" if it is
run on 6/2/2005 and "FileName_070205" if is run on 7/2/2005
there are two common ways to do so.
1. define an excel template as you need it and store it on the server. Copy
the file to the desired name and change the filename of the connection to
that copied file.

2. dynamicly change the connection filename to the desired name and then
execute a create table statement through this connection to create the file
and the table/sheet inside where you want to export to.

Which way to choose depends also on the requirement of preformatting the
excel output.
For hints on how to work with files or changing filename of connections
look here
http://www.sqldts.com/?101

Helge



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.