SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Data archive


Data archive

Author
Message
Zeal-DBA
Zeal-DBA
SSC-Addicted
SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)

Group: General Forum Members
Points: 435 Visits: 1125
hello experts,
i have a database which has around 10 tables which stores log of different operations of application. as i said there are log tables so they grows frequently, some of these data i use in application also,
actually i want to transfer some data of these table to a different database. after that i want to delete data from these tables, but each table shud have at least one month data. i how can accomplish that in a ssis package which i wud run every fortnightly and it will archive the data automatically, can any body suggest me

thank in advace
Adiga
Adiga
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3266 Visits: 21012
You can accomplish through the Execute SQL Task. You can write the custom sql script to meet your requirements.

Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
Zeal-DBA
Zeal-DBA
SSC-Addicted
SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)

Group: General Forum Members
Points: 435 Visits: 1125
can you suggest me what kind of sql script i'll have to write here
Adiga
Adiga
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3266 Visits: 21012

1)actually i want to transfer some data of these table to a different database.
2)after that i want to delete data from these tables, but each table shud have at least one month data.


1) The T-SQL query which will insert the requisite data into the other database
2) A delete statement which will delete the copied data from the source

Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
Zeal-DBA
Zeal-DBA
SSC-Addicted
SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)SSC-Addicted (435 reputation)

Group: General Forum Members
Points: 435 Visits: 1125
can you suggest me query to append data in existing table data
Adiga
Adiga
Hall of Fame
Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)Hall of Fame (3.3K reputation)

Group: General Forum Members
Points: 3266 Visits: 21012
Appending = Inserting

Please go through the INSERT statement details on MSDN.

Pradeep Adiga
Blog: sqldbadiaries.com
Twitter: @pradeepadiga
ColdCoffee
ColdCoffee
SSCarpal Tunnel
SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)SSCarpal Tunnel (4.6K reputation)

Group: General Forum Members
Points: 4645 Visits: 5550
Going through you request, i found that Table Partitioning might do the trick for you.. Me, in my sytem, implemented this Partition for Archive data; which is maintaining only the latest set (we have specific mechanism on we define sets using "versions" each time a job inserts data into the Archive tables) of data for each month in one filegroup and then "moving" the rest to the some another filegroup which will be located on a different drive..

If you are interested in this process, try going this awesome whitepaper from Kim Tripp : Partitioned Tables and Indexes in SQL Server 2005

Hope this helps! :-)
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search