SQL Server 2012 adds a new stored procedure called sp_describe_first_result_set.  This new procedure returns metadata for the result set returned from a query. The metadata is information about what the results will look like.  sp_describe_first_result_set is an alternative to sp_columns, and appears to perform much better than sp_columns. The information here has been extracted from my SQL Saturday presentation on Whats New in TSQL …

T-SQL 2012 Procedure sp_describe_first_result_set Read more »

# The key to twitter is to follow the right hash tags.  What hash tags do you follow related to Microsoft SQL Server? Here are a few of the twitter hash tags that I follow: #SQLServer The generic SQL Server hash tag. Most anything goes on this hash tag. #SQLHelp The #SQLHelp hash tag is great when you need to …

What twitter hash tags do you follow for SQL Server? Read more »

It has been a year since SQL Server 2012 released. There were some fun posts on Twitter about the SQL Server 2012 birthday or anniversary. For instance: and another anniversary query (which doesn’t actually run): 1 year out since SQL 2012 released, and here are some things to note: There is no more Business Intelligence Development Studio (BIDS) in SQL …

Happy Birthday SQL Server 2012 Read more »

SQL Server 2012 introduces the IIF statement. It is very similar to the IIF statement in MS Access. I have extracted the IIF part of my presentation on Whats new in SQL Server 2012, and turned it into a video with a demo of how to use the IIF statement. The IIF statement is a quick shortcut to simple CASE …

SQL Server 2012 IIF Statement Read more »

Throughout my career I have worked with different programming and database tools.  Thinking back the tools that I enjoyed using were the tools that were easy to get the job done, and the tools that I hated using were the tools that were the most difficult to use. Being good at what I do means mastering the tools so that …

3 Steps to Work More Efficiently in SSMS. Read more »

Last year while working on my CTE presentation for a SQL Saturday I added a blog post called “Using a CTE to Split a String Into Rows“, and since that posting I have used it many times. But as things go in development, eventually there is a need to do something more. Doing some complex string building to create files …

Using a CTE to Split a String Into Rows with Line Numbers Read more »

After writing a recent blog post on Are you wasting half the capacity of IDENTITY, I started thinking about how much is too big for an BIGINT IDENTITY. If you don’t know about, you can get Are you wasting half the capacity of IDENTITY 9,223,372,036,854,775,807 IDENTITY values out of a BIGINT in SQL Server.  Which in easier terminology is 9 with roughly 18 …

How BIG is too BIG for a BIGINT IDENTITY? Read more »

I just finished the Exploring the TSQL Enhancements in SQL Server 2012 presentation at SQL Saturday 166 in Olympia Washington. Thanks everyone who attended, I hope that you learned something useful. Here is the slides and sample code to download: Whats New in TSQL 2012 If you have any questions, please get in touch with me on Twitter  @SqlEmt  Remember to follow me …

Exploring the TSQL Enhancements in SQL Server 2012 – Slides and Sample Code Read more »

SQL Server 2012 introduces the SEQUENCE object.  Looking at the syntax it is very similar to how Oracle has implemented SEQUENCEs for many years.  I believe that the SEQUENCE was introduced to aid in the transition of Oracle developers to SQL Server. First off what is a SEQUENCE… A user-defined object that generates a sequence of numeric values. To create …

SQL Server 2012 – SEQUENCE Read more »