Forum Replies Created

Viewing 15 posts - 496 through 510 (of 3,738 total)

  • RE: Archiving Data Script

    Yes I should go with Try, Catch but I was to loop so that I only commit so many records at a time.

  • RE: Archiving Data Script

    I know that I still have to add the TRY... Catch logic but how else can I improve this code?

    DECLARE @ArchiveDate DateTime

    DECLARE @active bit

    DECLARE @RowCount int

    SET @active = (SELECT...

  • RE: Archiving Data Script

    I need something like the code listed below but it has to archive, Rollback if there is an error.

    Something very simple not.

    The following code only deletes and there is no...

  • RE: operand type clash. Text is incompatible with int when attempting to archive table

    I will look into it further.

    Thanks.

  • RE: Code to Archive Data

    I prefer to have a control table where you lookup the batch size, several other other field to include an active flag.

    If the flag is set to 1 it will...

  • RE: Code to Archive Data

    Jeff,

    That was a great presentation that you shared with me.

    Until I can get a solid and tested plan I have elected to write a script to archive and delete the...

  • RE: Code to Archive Data

    I clicked on it this time and opened as a new window and it worked.

    Thanks a bunch!:cool:

  • RE: Code to Archive Data

    Thanks Jeff.

    When I click on the like it directs me to the main forum page.

    I'm going to probably archive year.

    Thanks again.

  • RE: Code to Archive Data

    Jeff Moden (8/3/2015)


    Welsh Corgi (8/3/2015)


    There are 3 file groups and 6 files.

    Not that it will matter much but for what? The database or that one table?

    That is for the...

  • RE: Code to Archive Data

    Jeff Moden (8/3/2015)


    Welsh Corgi (8/3/2015)


    Jayanth_Kurup (8/2/2015)


    seems fairly simple , i would personally use partitioning since it handles the whole process with far less stress on the DB but it would...

  • RE: Code to Archive Data

    Eirikur Eiriksson (8/3/2015)


    Quick question, is ISArchive ever used and then how?

    😎

    Not it is not being used.

  • RE: Code to Archive Data

    J Livingston SQL (8/3/2015)


    Welsh Corgi (8/3/2015)


    How is this?

    Can you see how it could be Improved?

    DECLARE @NextIDs TABLE(UniqueID int primary key)

    DECLARE @ThreeYearsAgo datetime

    SELECT @ThreeYearsAgo = DATEADD(d, -(3 * 365), GetDate())

    as a...

  • RE: Code to Archive Data

    Eirikur Eiriksson (8/3/2015)


    Quick question, is ISArchive ever used and then how?

    😎

    No it has not been used.

    I need to create a table and add a bit flag to stop the looping...

  • RE: Code to Archive Data

    How is this?

    Can you see how it could be Improved?

    DECLARE @NextIDs TABLE(UniqueID int primary key)

    DECLARE @ThreeYearsAgo datetime

    SELECT @ThreeYearsAgo = DATEADD(d, -(3 * 365), GetDate())

    WHILE EXISTS(SELECT 1 FROM [ISAdminDB].[dbo].[MyTable] WHERE [MyTable].[DateTime]...

  • RE: Code to Archive Data

    The following code archives and deletes records. But it does not contain a while loop to limit the batch size for the number of records that are committed.

    Any ideas?

    CREATE PROC...

Viewing 15 posts - 496 through 510 (of 3,738 total)