![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Hi, I have data going from SQL to an Excel file with a DTS package. Each time I run this is adds the data to the existing data in the spreadsheet (that was there from the last time I ran it). How can I make it overwrite what is in the spreadsheet instead of append to it? Or better yet, is there a way to have it create an entire new spreadsheet, automatically, each time. I want to get this as automated as possible so on a given date it will pull the data from SQL and create a new spreadsheet. Can that be done? Thanks, Dan |
#3
| |||
| |||
|
|
Personally I drop and recreate the Excel "Table" before i do the datapump each time -- -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Dan B" <none (AT) none (DOT) com> wrote in message news:O5$VppdjDHA.2404 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hi, I have data going from SQL to an Excel file with a DTS package. Each time I run this is adds the data to the existing data in the spreadsheet (that was there from the last time I ran it). How can I make it overwrite what is in the spreadsheet instead of append to it? Or better yet, is there a way to have it create an entire new spreadsheet, automatically, each time. I want to get this as automated as possible so on a given date it will pull the data from SQL and create a new spreadsheet. Can that be done? Thanks, Dan |
#4
| |||
| |||
|
|
I tried this too and it just appended the data to what was already there. It would not drop it. What am I missing? Is there some sample code or something you could post? Thanks, Dan "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:u6v5sTejDHA.3320 (AT) tk2msftngp13 (DOT) phx.gbl... Personally I drop and recreate the Excel "Table" before i do the datapump each time -- -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Dan B" <none (AT) none (DOT) com> wrote in message news:O5$VppdjDHA.2404 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hi, I have data going from SQL to an Excel file with a DTS package. Each time I run this is adds the data to the existing data in the spreadsheet (that was there from the last time I ran it). How can I make it overwrite what is in the spreadsheet instead of append to it? Or better yet, is there a way to have it create an entire new spreadsheet, automatically, each time. I want to get this as automated as possible so on a given date it will pull the data from SQL and create a new spreadsheet. Can that be done? Thanks, Dan |
#5
| |||
| |||
|
|
Complex Transformation Sample from SQL Server to Excel This program copies data from the pubs database to a Microsoft® Excel |
|
I tried this too and it just appended the data to what was already there. It would not drop it. What am I missing? Is there some sample code or something you could post? Thanks, Dan "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:u6v5sTejDHA.3320 (AT) tk2msftngp13 (DOT) phx.gbl... Personally I drop and recreate the Excel "Table" before i do the datapump each time -- -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Dan B" <none (AT) none (DOT) com> wrote in message news:O5$VppdjDHA.2404 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hi, I have data going from SQL to an Excel file with a DTS package. Each time I run this is adds the data to the existing data in the spreadsheet (that was there from the last time I ran it). How can I make it overwrite what is in the spreadsheet instead of append to it? Or better yet, is there a way to have it create an entire new spreadsheet, automatically, each time. I want to get this as automated as possible so on a given date it will pull the data from SQL and create a new spreadsheet. Can that be done? Thanks, Dan |
#6
| |||
| |||
|
|
Using a Datapump between SQL Server and Excel. Authors table in Pubs --> Excel First Task: ExecuteSQL task Excel Connection Text DROP TABLE Authors On Success Second Task: ExecuteSQL task Excel Connection Text CREATE TABLE authors ( au_id VarChar (11) , au_lname VarChar (40) , au_fname VarChar (20) , phone VarChar (12) , address VarChar (40) , city VarChar (20) , state VarChar (2) , zip VarChar (5) , contract Bit ) On Success Third Task: DataPump Task. -- -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Dan B" <none (AT) none (DOT) com> wrote in message news:eSskC7ejDHA.2000 (AT) TK2MSFTNGP12 (DOT) phx.gbl... I tried this too and it just appended the data to what was already there. It would not drop it. What am I missing? Is there some sample code or something you could post? Thanks, Dan "Allan Mitchell" <allan (AT) no-spam (DOT) sqldts.com> wrote in message news:u6v5sTejDHA.3320 (AT) tk2msftngp13 (DOT) phx.gbl... Personally I drop and recreate the Excel "Table" before i do the datapump each time -- -- Allan Mitchell (Microsoft SQL Server MVP) MCSE,MCDBA www.SQLDTS.com I support PASS - the definitive, global community for SQL Server professionals - http://www.sqlpass.org "Dan B" <none (AT) none (DOT) com> wrote in message news:O5$VppdjDHA.2404 (AT) TK2MSFTNGP12 (DOT) phx.gbl... Hi, I have data going from SQL to an Excel file with a DTS package. Each time I run this is adds the data to the existing data in the spreadsheet (that was there from the last time I ran it). How can I make it overwrite what is in the spreadsheet instead of append to it? Or better yet, is there a way to have it create an entire new spreadsheet, automatically, each time. I want to get this as automated as possible so on a given date it will pull the data from SQL and create a new spreadsheet. Can that be done? Thanks, Dan |
![]() |
| Thread Tools | |
| Display Modes | |
| |