O'Reilly logo

SQL Server 2012 T-SQL Recipes: A Problem-Solution Approach by Jonathan Gennick, Wayne Sheffield, Andy Roberts, David Dye, Jason Brimhall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

CHAPTER 18

image

User-Defined Functions and Types

by Jason Brimhall

In this chapter, I’ll present recipes for user-defined functions and types. User-defined functions (UDFs) allow you to encapsulate both logic and subroutines into a single function that can then be used within your Transact-SQL queries and programmatic objects. User-defined types (UDTs) allow you to create an alias type based on an underlying system data type, enforcing a specific data type, length, and nullability.

In this chapter, I’ll also cover the SQL Server user-defined table type, which can be used as a user-defined table parameter for passing table result sets within your T-SQL ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required