New England Data Camp v.1.0

January 7, 2009 at 3:25 pm (PASS, SQL Server 2008, TSQL) (, , )

It’s getting a lot closer to the 24th. 

On Saturday, January 24th, the first ever New England Data Camp will launch. We’ve got a number of speakers registered. Aaron Bertrand and Andrew Novick are guys I’ve got a lot respect for. I’ve been to their presentations before and they’ve been consistently very good.  We’ve got a few guys I haven’t heard of personally, Talbott Crowell, Ayad Shammout, Sunil Kadimdiwan, Igor Moochnick. I’m going to present on execution plans and multi-environment deployments using DBPro (updated from the PASS presentation).  The other presentations cover topics from using the Resource Governor on SQL Server 2008 to Defending SQL Server from Injection Attacks to Create better and more Useful Cubes.

It’s shaping up to be an actual event. If you’re in the neighborhood (New England), stop by.

The main organizer is Adam Machanic of the New England SQL Server Users Group. That’s partnered with the Southern New England SQL Server Users Group. It’s all under the banner of PASS.

It’s taking place at the Microsoft facility in Waltham on Saturday, January 24th. You can register here. If you’re interested in presenting, speaker registration is here.

UPDATE: Misspelled Aaron’s name. Sorry man.

Permalink 1 Comment

Table Valued Functions

January 7, 2009 at 7:43 am (TSQL) (, , )

I’ve been blogging for a whole nine months now. I decided to look back and see what’s bringing people to the site. The number one search phrase is “sql server 2005 service pack 3” but the overwhelming topic that most people are using to get to the site are user defined functions, specifically multi-statement table valued user defined functions.

It’s completely understandable. Ever since I first saw these things in use back in SQL Server 2000, I thought they were slick. Unfortunately appearances can be deceiving. The reason so many people are searching out information on these things is because they just don’t work very well. SQL Server can’t create statistics on the tables generated through the multi-statement UDF. Because it has no statistics to work with, the query optimizer assumes that each of these tables has a single row. Creating execution plans for only a single row of data works well when there is only a single row, or just a few rows, of data. But when you have hundreds, thousands, or more, it breaks down very quickly.

Because of this rather severe short coming, I recommend avoiding the use of multi-statement table valued functions. There are any number of tests (look through Gail’s blog, just for starters) proving this for those who are skeptical and think that, if they just adjust the right little bit of the query, it’ll move millions of rows through 8 layers of functions lickety split. It won’t. It can’t. Stop trying.

The single statement functions, parameterized views as they’re sometimes referred to, work very well, so feel free to use them if they’ll help your code. They resolve out, like views, into actual execution plans based on the statistics within the database.

Permalink Leave a Comment