Archive for 2010

Powershell… Making it difficult for yourself!

Today I was reading the post Powershell is Really Easy… If you know what you’re doing and it really struck a chord with me. A few days ago I discovered the ConvertTo-HTML cmdlet that can easily convert Powershell objects into formatted html pages. As I’ve written a few scripts producing html output, by sticking together […]

Gathering SQL Server Data Cache Information: Part 2

In a previous post I showed how you can collect information on what is held in the data cache. The data collected here was just a simple summary of how much space each database was consuming. While useful we will need more detailed information on what is inside the cache to get a proper handle […]

Gathering SQL Server Data Cache Information

I’m currently building a CMDB at work and I wanted to include a bit of performance data in the information collected. The data cache is probably the biggest consumer of memory within SQL Server so It makes sense to collect this for future analysis. As a start I’m gathering the amount of space each database […]

Using sp_rename with schemas

I’ve noticed people before struggling using sp_rename with tables that aren’t in the default schema. Many people don’t use schemas, so there’s often confusion, when they finally do come across the need to rename a table belonging to another schema. Assuming the below ‘Suppliers’ table is in the users default schema (usually dbo) then the […]

Deleting sequential duplicates with TSQL

I was recently given a du-duping task which was much more difficult than I anticipated and taxed my SQL brain to its limits. I thought of using a CTE to do this but all of the examples I could find for deleting records with a CTE wouldn’t have worked in my situation. Essentially the table […]