sql server 2008 - Create a UDT that has SQL @tables as its members -


I wonder if SQL Server 2008 is possible to create a CLR user-defined type, of which the table variables will be

As you know, you can declare a table variable:

  Announce the @fu table (row_id int null ...);  

So I imagine a UDT with many members, each of which is a defined table (a separate table, of course), so it would be possible to say: Select the ID from / p>

  @ typed_var.table1 where ...  

or

  @typed_var.table3 (id ) Enter values ​​(...)  

I'm feeling a lot more on this, but yes or no sure on the internet can not be found. Is this possible?

No, this is not possible. SQL Server will not let you select or insert in UDT's property.

I tried to do this, and got the error below:

  Make a type of child type table (A int, b int) in the form of table, childTable2 table Create the form (c int) as the table type (First Child Child Tablet, Second Child ChildTable 2) Message 350, Level 16, State 1, Line 1 Column "FirstChill" has no valid data type, a column user Can not be of a specified table type.  

Comments