Microsoft SQL Server – Complex Cleanup

Today my team manager asked me to create small interesting sql script.┬áThis script recieves time interval on input, splits given time interval into smaller parts (let’s say 24 hours per interval), counts total number of records for each interval, outputs this information and deletes records. Script mustn’t delete top”fresh” records though. E.g. manager would like to specify offset parameter, so records from interval [today-offset;today] mustn’t be deleted. Read the rest of this entry »


Microsoft SQL Server – gathering tables information

Let’s examine how we can output some statistical information about database tables.

Read the rest of this entry »

Microsoft SQL Server – measure operation time

In previous post we’ve described how to get simple good looking information about your data. Now let’s try to find out how we can measure time required by db operation (stored procedure, sql query etc) to perform. Read the rest of this entry »

Microsoft SQL Server – statistics

I’ve recieved interesting task from my boss. I need to prepare a few stats for MS SQL Server so let’s do it.

Read the rest of this entry »