Results 1 to 2 of 2

Thread: Archiving rows using a Date Field

  1. #1
    Tom Carter Guest

    Archiving rows using a Date Field

    Hi all,

    Would anyone be able to point me in the right direction for creating a procedure to archive rows using a DATE field value as the determinant for selecting the rows to be moved to a backup table?

    I'd really appreciate any assistance that anyone can provide.

    Thanks,
    Tom C.

  2. #2
    JoanO Guest

    Archiving rows using a Date Field (reply)

    You can use select into to put the data in another table...for example, this query takes data out of tblmain where the year of submitted_dt is > 1996 and puts it into a table called newtablename.

    select *
    into newtablename
    from tblmain
    where datepart(year, submitted_dt) > 1996

    Then you would have to delete the data in the original table changing the select to a delete. (backup the table before doing the delete and make sure the row counts for the select and the delete are the same.)

    ------------
    Tom Carter at 6/6/00 5:16:54 PM

    Hi all,

    Would anyone be able to point me in the right direction for creating a procedure to archive rows using a DATE field value as the determinant for selecting the rows to be moved to a backup table?

    I'd really appreciate any assistance that anyone can provide.

    Thanks,
    Tom C.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •