Moving Day

  • Comments posted to this topic are about the item Moving Day

  • I'd love to see (and please let me know if it already exists!) a way to find out when a table was last selected from. We can set up our own logs for statements which affect the data.

    With that we could say "lets delete stuff which hasn't been used for a year".

  • We just went live this past Monday with a migration from SQL 2000 to SQL 2008. This migration also included new servers, new OS (Win2008), Failover Clustering, Virtual Servers (Hyper V) and even went to the 64 bit SQL Server edition. With so many changes occuring at one time we were reluctant to "Clean House". We wanted to make sure if something went wrong it was with the new technology and not something we did by cleanning house.

    As of today, we had very little problems with the move. Everything is working as planned. I am now planning to take the broom out of the closet and try to get rid of things that are no longer needed.

  • Ben Moorhouse (9/17/2009)


    I'd love to see (and please let me know if it already exists!) a way to find out when a table was last selected from. We can set up our own logs for statements which affect the data.

    With that we could say "lets delete stuff which hasn't been used for a year".

    There isn't a magical switch, at least not that I'm aware of. But you could create a DDL trigger to capture any changes there, and you could create a trace to capture all of the dml changes to the table. That would get what you want, but it would be a PITA.

    As far as Steve's idea of "deprecate that" function, I would love to see that.

    A backward approach could be made. All of the procedures we have here include insert statements into a logging table. I guess we could search for rows referencing items from sys.procedures and grab those objects not in the logging table. (Unfortunately, we only keep 45 days worth of data)

    Couldn't agree more with the need for housekeeping.

    Honor Super Omnia-
    Jason Miller

  • Apologies Jason - I meant that I knew we could log changes to objects and data. It's the ability to log select statements which would be incredibly helpful to me.

    Not just for housekeeping either, but for identifying people who write bad/inefficient code.

  • Ben Moorhouse (9/17/2009)


    Apologies Jason - I meant that I knew we could log changes to objects and data. It's the ability to log select statements which would be incredibly helpful to me.

    Not just for housekeeping either, but for identifying people who write bad/inefficient code.

    You can capture that as well. We have a trace that runs on our production reporting server to capture every single statement that executes on the machine. Let's just say we had some values changed, and "nobody" did it...

    Honor Super Omnia-
    Jason Miller

  • We currently have a database on a shared server with other departments.

    We will be moving to our own hardware soon, so that might be something we can do.

    Thanks for the pointer!

  • Jason Miller-476791 (9/17/2009)

    As far as Steve's idea of "deprecate that" function, I would love to see that.

    A backward approach could be made. All of the procedures we have here include insert statements into a logging table. I guess we could search for rows referencing items from sys.procedures and grab those objects not in the logging table. (Unfortunately, we only keep 45 days worth of data)

    Couldn't agree more with the need for housekeeping.

    I nominate Steve to open a connect item. I'd be very happy to vote for it as I think this is something that would very, very great to have in a future version.

    -Luke.

    To help us help you read this[/url]For better help with performance problems please read this[/url]

  • We just had a major release and I renamed all the old objects with old_. It felt sooooo good. If no errors in a month, they'll go away permanently.

  • I do something similar, objects which we believe to be no longer in use we rename for example.

    tblLoginHistory

    becomes

    tblLoginHistory_UNUSED090917

    Then if something breaks or someone shouts we can quickly and easily rename it back. If 6months passes and it's still named the same then we take a backup and drop it.

  • I'm with Steve,

    That would be an extremely useful function....

  • The day after you drop the table that hasn't been used for 3 years, someone will need it for a report due in twenty minutes! 😛

  • ha ha! yes - That always seems to happen!

  • I coded a tool to track dependencies between code and database. It comes vey handy when you have your house keeping to do, but it's even more useful when you have to identify objects that will be involved when changing code or db objects.

    Unfortunately it's modeled on my dev environment, so probably you won't find it useful. I will try to make it more flexible and maybe attach it here if I succeed.

    -- Gianluca Sartori

  • bpportman (9/17/2009)


    We just had a major release and I renamed all the old objects with old_. It felt sooooo good. If no errors in a month, they'll go away permanently.

    Be careful of a month, and make sure you save a copy off. I have been bitten by things that run once a year for some EOY process.

    I've opened a Connect item for it.

    https://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=490420

Viewing 15 posts - 1 through 15 (of 35 total)

You must be logged in to reply to this topic. Login to reply