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