Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Urgent Requirement Expand / Collapse
Author
Message
Posted Monday, July 13, 2009 10:02 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, March 29, 2012 5:22 AM
Points: 260, Visits: 800
Requirement :

Database : with 520 tables (not all the tables contain huge data volume).
One procedure , using the condition "DateCreated" (column) should be written. Which needs to filter (transfers) 6 months data into another Database on the same server or another server.

and that procedure must delete the older data of 6 months before, once the transfer is done. And this procedure will be scheduled every month first sunday.


Any ideas..... please post replies here, as its a very urgent task..!!!



Cheers,
- Win.

" Have a great day "
Post #752458
Posted Monday, July 13, 2009 10:22 PM


SSChampion

SSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampionSSChampion

Group: General Forum Members
Last Login: Today @ 5:35 AM
Points: 12,921, Visits: 32,289
do all 520 tables have the DateCreated column with a default of getdate(), so that the tables can be queried individually to archive off the data as desired?

if not, you could add the column today, but if you have a backup from 6 months ago, you could restore that as a different database, and determine what is "new" in the current production database, to help define what is older.

why is it urgent? are you running out of disk space?

what happens if a parent record is 6 months old, but a child record related to the parent is 3 months old? maybe you mean just certain tables should be archived?


Lowell

--There is no spoon, and there's no default ORDER BY in sql server either.
Actually, Common Sense is so rare, it should be considered a Superpower. --my son
Post #752461
Posted Monday, July 13, 2009 10:57 PM


SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Thursday, March 29, 2012 5:22 AM
Points: 260, Visits: 800
Thanks Lowell for your Quick response ..

do all 520 tables have the DateCreated column with a default of getdate(), so that the tables can be queried individually to archive off the data as desired?

- Yes all the tables have "DateCreated" column


if not, you could add the column today, but if you have a backup from 6 months ago, you could restore that as a different database, and determine what is "new" in the current production database, to help define what is older.

- Requirement is that the data older than 6 months should be moved to another server with the same database name. For better performance this requirement was raised and this must be finished by today,...


why is it urgent? are you running out of disk space?
- Its a requirement now from my Administration and our request tooo, to improve the performance.


what happens if a parent record is 6 months old, but a child record related to the parent is 3 months old? maybe you mean just certain tables should be archived?
- Yes, i mean that the data older than 6 months should be moved out from Live DB and should be deleted once the transfer of data is succeeded. If the child record is required then we will pull the data from the archived DB. That will not be a problem...

If wrong, Suggest me !!!

Any scripts or the tools please...!!



Cheers,
- Win.

" Have a great day "
Post #752470
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse