473,591 Members | 2,926 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Exporting SQL to Excel Hourly

First time here so please bear with me.

Set up a DTS package to export data to an excel sheet on an hourly
basis. Problem is, it keeps appending to the same excel sheet.

Any idea how to prevent that. All I want to accomplish is that every
hour, the latest data is in the excel sheet and the previous data is
deleted.

Thanks in advance!
Jul 20 '05 #1
5 1709

"Anthony" <an*****@alfy.c om> wrote in message
news:8c******** *************** ***@posting.goo gle.com...
First time here so please bear with me.

Set up a DTS package to export data to an excel sheet on an hourly
basis. Problem is, it keeps appending to the same excel sheet.

Any idea how to prevent that. All I want to accomplish is that every
hour, the latest data is in the excel sheet and the previous data is
deleted.

Thanks in advance!


One solution could be to add an ActiveX or Execute Process task to simply
delete the existing XLS before exporting the data, so that you create it
again each time. This could be a problem if someone else has the XLS open at
that point, but presumably you've handled that already anyway.

Simon
Jul 20 '05 #2


Thanks Simon. Not to familiar with creating an ActiveX to do that. Any
idea how easy/hard it is? Maybe point me in the right direction?

Thanks again

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #3
Here is another approach.
1.) create a sql agent job and schedule it to run hourly.

2.) first step deletes the old excel file (change type to cmdexec and
"DEL \\<path>\<name> .xls" in the command line.

3.) second step creates a new excel file by copying a template file to
the path and file name you want.

4.) create a stored procedure that creates a linked server to the excel
spreadsheet (see BOL for sp_addlinkedser ver), then exports the data to
it.

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #4
Hi

These may be useful.
http://www.sqldts.com/default.aspx?292
http://www.sqldts.com/default.aspx?200
http://www.sqldts.com/default.aspx?245

If you need a specific template then you can copy an existing file and
rename it.

John

"Anthony Mehale" <an*****@alfy.c om> wrote in message
news:40******** **************@ news.newsgroups .ws...


Thanks Simon. Not to familiar with creating an ActiveX to do that. Any
idea how easy/hard it is? Maybe point me in the right direction?

Thanks again

*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!

Jul 20 '05 #5

Thanks Carl
*** Sent via Devdex http://www.devdex.com ***
Don't just participate in USENET...get rewarded for it!
Jul 20 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
9236
by: sridevi | last post by:
Hello How to export data from ms-access database to excel worksheet using ASP. mainly i need to export data to multiple worksheets. it is very urgent to us. i have a sample code which works only exporting to single worksheet. but i need to export data to multiple worksheets. it is very urgent to us. so please help me in code.
4
3939
by: D | last post by:
I've created a report with many subreports of aggregate data. I want my client to be able to export this data to Excel to make her charts, etc. Only one problem: one of the fields is a "SchoolYear" TEXT field that contains data such as 2000/01, 2001/02, etc. If I export a Query with this kind of data to Excel, it gives me the text value of this field; however, when I export a Report bound to this TEXT field, Excel gives me the values 36526,...
2
7700
by: G | last post by:
When I export data from access to excel by with "export" or "Analyze with" I seem to loose parts of some fields (long text strings). Is there a way to export it all to excel? Thanks G
2
7986
by: Kenneth | last post by:
How do I remove the limitation in Access that deny me from exporting 24000 rows and 17 columns (in a query) into Excel? Kenneth
5
3087
by: Neil | last post by:
Hi I'm currently exporting my datagrid to excel, taking advantage of the fact that excel can render html, the problem is that when i click the button to export it opens in browser, I want the button to launch Excel and leave the browser as is Any help appreciate p.s. I know that this can be achieved by changing the settings on the client machine and de-selecting the 'browse in same window' for .xls extensions but this is not acceptable...
2
6913
by: Mustufa Baig | last post by:
Hi everybody, I have an ASP.NET website where clients can view their monthly billings by selecting different options. One of the option is the way they want to see the report i.e. whether they want to see it in PDF or EXCEL etc etc..... What I am trying to acheive is depending on their choice of format, I want to send the stream of that particulae selected format to the browser. I have tried couple od solutions but I couldn't able to get...
1
3153
by: Mustufa Baig | last post by:
I have an ASP.NET website where I am showing off crystal reports to users by exporting them to pdf format. Following is the code: ---------------- 1 Private Sub ExportReport() 2 Dim oStream As System.IO.MemoryStream = 3 myReport.ExportToStream( ExportFormatType.PortableDocFormat) 4 Response.Clear() 5 Response.Buffer() = True
2
2396
by: bienwell | last post by:
Hi, I have a question about exporting data from datagrid control into Excel file in ASP.NET. On my Web page, I have a linkbutton "Export data". This link will call a Sub Function to perform exporting ALL data from the datagrid control. Exporting data works fine when I show all data on the datagrid control. I'd like to shows only 30 records on the datagrid control instead of ALL data using page navigation, and perform exporting...
2
3165
by: Snozz | last post by:
The short of it: If you needed to import a CSV file of a certain structure on a regular basis(say 32 csv files, each to one a table in 32 databases), what would be your first instinct on how to set this up so as to do it reliably and minimize overhead? There are currently no constraints on the destination table. Assume the user or some configuration specifies the database name, server name, and filename+fullpath. The server is SQL...
0
7870
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8236
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8362
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7992
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6639
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
3850
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
3891
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1465
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
1199
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.