September 16, 2009 at 9:23 pm
Comments posted to this topic are about the item Moving Day
September 17, 2009 at 3:14 am
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".
September 17, 2009 at 5:14 am
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.
September 17, 2009 at 5:57 am
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
September 17, 2009 at 6:04 am
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.
September 17, 2009 at 6:07 am
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
September 17, 2009 at 6:10 am
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!
September 17, 2009 at 7:10 am
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.
September 17, 2009 at 7:30 am
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.
September 17, 2009 at 7:48 am
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.
September 17, 2009 at 7:56 am
I'm with Steve,
That would be an extremely useful function....
September 17, 2009 at 8:18 am
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! 😛
September 17, 2009 at 8:21 am
ha ha! yes - That always seems to happen!
September 17, 2009 at 8:27 am
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
September 17, 2009 at 8:35 am
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