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


Urgent Requirement


Urgent Requirement

Author
Message
- Win.
- Win.
SSC-Addicted
SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)

Group: General Forum Members
Points: 494 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 "
Lowell
Lowell
One Orange Chip
One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)One Orange Chip (27K reputation)

Group: General Forum Members
Points: 27916 Visits: 39921
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

--
help us help you! If you post a question, make sure you include a CREATE TABLE... statement and INSERT INTO... statement into that table to give the volunteers here representative data. with your description of the problem, we can provide a tested, verifiable solution to your question! asking the question the right way gets you a tested answer the fastest way possible!

- Win.
- Win.
SSC-Addicted
SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)SSC-Addicted (494 reputation)

Group: General Forum Members
Points: 494 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 "
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