The question came up as to how do I parse a query string using TSQL.  So here you go, using a common table expression, and basing this on a similar function to what I put together yesterday for split. which produces this output. A quick and easy way to parse a query string  in TSQL using a CTE. Receive a …

Using a CTE in a Function to Split Up a Query String Read more »

Part of SQL Server running queries is that once a query is analyzed, parsed and compiled, that compiled plan is kept in memory so that it can be quickly re-used in the future. If you are using proper parameterized queries, most of your queries will get kept around and re-used saving lots of CPU and memory on SQL Server. If …

How big is your procedure cache? Read more »

I learned this from one of my co-workers.  A quick tip for formatting SSRS reports. When you are in the SSRS report editor, and you want to move the currently selected object (or objects), you can move them with the arrow keys.  Most people who have used SSRS know that one, but did you know that if you use the …

SSRS Editor Tip of the Day… CTRL + Arrows Read more »

This is part 19 two left outer JOINS of a 19 part series on TSQL Basics. You will first gain an understanding of the differences between each of these types of JOINS, and when they should be used. Then we’ll explore some common uses for JOINS, such as replacing a not in clause with JOIN to get the same results …

TSQL Basics Part 19: TWO LEFT OUTER JOINS – Video Explanation Read more »

After my CTE presentation a while back I was asked many questions, and received several great suggestions from people.   One question was how does the performance compare between a recursive CTE to generate a hierarchical tree path listing and a query using self JOINs and UNION ALL to generate similar results.  To test this I created a simple table …

CTE Hierarchy compared to the alternative Read more »

This is very useful if you are creating many reports based on a single template. To start with when you use the “Add new Item” functionality into a report project, this is all you get.  Report Wizard, Report, and Data Source.  Then searching Online Templates is not very useful.  So how do I add my own SSRS rdl templates. Steps: …

Using your own RDL as a SSRS Template Read more »

This is part 18 “two inner JOINS” of a 19 part series on TSQL Basics. You will first gain an understanding of the differences between each of these types of JOINS, and when they should be used. Then we’ll explore some common uses for JOINS, such as replacing a not in clause with JOIN to get the same results with …

TSQL Basics Part 18: TWO INNER JOINS Read more »

When creating a table you can specify IDENTITY with the following syntax: For example The IDENTITY property is valid for data types of the integer data type category, except for the bit data type, or decimal data type.  So how many rows can you insert into that table?  It depends on the data type used. What happens when I run …

Are you wasting half the capacity of IDENTITY? Read more »

This is part 17 “two full outer JOINS” of a 19 part series on TSQL Basics. You will first gain an understanding of the differences between each of these types of JOINS, and when they should be used. Then we’ll explore some common uses for JOINS, such as replacing a not in clause with JOIN to get the same results …

TSQL Basics Part 17: TWO FULL OUTER JOINS Read more »