Archive for month: December, 2011

SQL Cannot Produce Query Plan Error

22 Dec
December 22, 2011

Today I ran into the following SQL Server error while trying to run some Filtered Indexes:

Query processor could not produce a query plan because of the hints defined in this query. Resubmit the query without specifying any hints and without using SET FORCEPLAN.

In this post I go through the possible reasons for this Query Processor error, and how to solve each of those.

Read more →

SQL Server RECOMPILE Query Option

22 Dec
December 22, 2011

A simple example on SQL Server’s RECOMPILE query option.

Read more →

SQL Server Force Index Usage Table Hint

22 Dec
December 22, 2011

A quick example that shows how to force SQL Server to use a specified index when generating the Query Plan

Read more →

Format T-SQL Code (Pretty Print)

18 Dec
December 18, 2011

There is nothing more annoying than having to go through SQL Server code line by line trying to get the formatting of the each statement correct, in order to be able to reach the code. SQL Server (or any SQL Engine) has a multitude of plugins and online SQL code formatting tools. This short post goes through one online tool to format SQL Server code.

Read more →

Execute PHP File Within C#

10 Dec
December 10, 2011

Running PHP from C-Sharp is not a great way to go about building a stable code base, but sometimes it is a necessary evil.

I’ve ran into this very issue recently when trying to convert a new PHP PageRank hashing algorithm into C-Sharp, the problem mainly stemmed from the fact that the code did a lot of Byte Shifting, which is does not map from one programming language to another easily, and so thought I would share my experience regarding how to run PHP code in csharp.

Read more →

SQL Server Active Transaction Text

06 Dec
December 6, 2011

I was having issues today with my SQL Server Activity Monitor, it kept timing out every time I tried to see active transactions, and so I devised this wee script which returns the currently active transactions in the instance, as well as the text of the procedure running.

Read more →