SQL Server Query Performance Analysis using DMVs

Continuing the TSQL theme I thought it would be worthwhile sharing some TSQL scripts that I have been using over the years for tuning SQL Server queries… From the development perspective I often have to perform an analysis of a database application. More often than not this entails looking at a running system and ensuring…

4

Adventures in TSQL: Using CTEs when performing DELETE/UPDATE operations

It seems in quite a few applications of late there has been the requirement to batch process, in a distinct order, a series of entries from a table; namely a processing queue. Without delving in broker services this is easily managed using standard TSQL. The requirement is to delete a predefined number of entries from…

0

Adventures in TSQL: Adding date and time values

With the addition of the SQL Server date and time types, I have often found myself needing to create a datetime (or datetime2) value based on the addition of a date and a time value. However, there is no built-in function for such an operation. There are a few solutions to this problem that encompass…

3

Adventures in TSQL: Comma separated string from column values

It seems that several times now I have had the requirement to create a comma separated string from column values. The latest reason for doing this was to build up a list of table column names such that a view could be generated for the table. This is surprisingly easy to do in TSQL. One…

2

Creating a Partitioned View in the BAM Archiving Database

When you run the BAM data maintenance package (BAM_DM_<activity name>) BAM copies each partition in the BAM Primary Import database to a separate table in the BAM Archive database. You can create partitioned views in the BAM Archive database to facilitate locating the data. However one is left to create these partitioned views oneself. A…

0

F# Dynamic Lookup Operator and Regex

In a recent post I talked about using String.forall for string matching over the use of Regex: http://blogs.msdn.com/b/carlnol/archive/2011/10/20/f-string-extension-methods-rather-than-using-regex.aspx I do however use Regex a lot for other types of processing. One thing I find myself doing a bit is capturing values from a Match. If you find yourself doing this a lot the Dynamic Lookup…

0

F# Parallel Execution and Future Tasks

In a previous post I talked about some options around performing parallel executions by providing some wrappers that allowed a collection of functions to be executed in parallel: http://blogs.msdn.com/b/carlnol/archive/2011/07/17/f-and-running-parallel-tasks.aspx However there is another approach one could take. The main challenge in performing parallel code using Tasks in F# is managing and casting objects to the…

0