Chapter 16 — Table-Valued Parameters

Don Kiely’s illustrations of TVP’s are absolutely excellent in this chapter!

One of the roles that many of us find ourselves occupying our time with is that of database development.  Regardless of the title that resides on your business card, if you have been following this blog for the past 15 weeks and own this book you have done your fair share of database development.  As I’m sure many of you can attest to, it has been frustrating in the past to work with an array that developers love to use (and for great reason).  To get around this issue in the past, I would typically create a udf that allowed an “array” to be passed into it… There are numerous downsides to this including differing data types, delimiters and re-usability.  Yet as many of you can attest to, this was one manner to accomplish what has now become native to t-sql; Table-Valued Parameters. 

The ability to now do multiple inserts with one request from a web application is huge when it comes to performance of your application and your database.  As we discussed way back in chapter 4, set based sql performs significantly better than iterative based sql.  If you are in the process of making many round trips to a database for a dml operation, I’d encourage you to dive into this chapter by Don and take full advantage of what the author calls “… the best of the productivity features that Microsoft introduced in SQL Server 2008”. 

Wow!  That’s a strong statement that I’d agree with even considering other items that I’d consider very strong candidates such as the merge statement and Policy Management.

If TVP’s haven’t been explored by you, your db developers or your t-sql .net writing teammates, download the sql examples that Don provided as part of the chapter and get your productivity on!


0 Responses to “Chapter 16 — Table-Valued Parameters”

  1. Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s


Enter your email address to subscribe to this blog and receive notifications of new posts by email.

Join 11 other followers