Home > Archive > MS SQL Server > January 2006 > Purge data dynamically









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author Purge data dynamically
David

2006-01-30, 11:23 am

I want to delete data from all the tables dynamically. I have a table that
consists of
columns:

RecID, -- Identity(1,1)
Table_Name,
Column_Name, -- Date column to use for purging in that table
NumberOfDays, -- Number of days to keep the data and delete before this day.

How can I write a dynamic SQL to include in a procedure? Thanks for your
response.


David

2006-01-30, 1:23 pm

Never mind. I got it. If anyone needs the script, I can post.

"David" wrote:

> I want to delete data from all the tables dynamically. I have a table that
> consists of
> columns:
>
> RecID, -- Identity(1,1)
> Table_Name,
> Column_Name, -- Date column to use for purging in that table
> NumberOfDays, -- Number of days to keep the data and delete before this day.
>
> How can I write a dynamic SQL to include in a procedure? Thanks for your
> response.
>
>

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com