Table Valued Parameters (TVPs) and User Defined Table Types (UDTTs)

Table Valued Parameters and User Defined Table Type are available from SQL Server 2008 but still many developers are not aware of it. Before SQL Server 2008 it was not possible to pass a table variable to a stored procedure, for that case we mostly relied on xml data type to send multiple rows to a stored procedure. Now we can use Table Valued Parameters in stored procedure, and to use Table Valued Parameters we need to create a User Defined Table Type.

User Defined Table Type and Table Valued Parameter

A user-defined table type is a user-defined type that represents the definition of a table structure. You can use a user-defined table type to declare table-valued parameters for stored procedures or functions, or to declare table variables that you want to use in a batch or in the body of a stored procedure or function. Using Table Valued Parameter we can easily pass multi row data to stored procedure.

Read more from CodeProject.com

Advertisements

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 )

Twitter picture

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

Facebook photo

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

Google+ photo

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

Connecting to %s