4
我想知道是否可以在SQL Server 2008成員中創建一個CLR用戶定義類型,其成員將是表變量。創建一個具有SQL @tables作爲其成員的UDT
你知道,你可以聲明表變量:
declare @foo table (row_id int not null ...);
所以我看中了UDT與幾個成員,每個成員的是(當然不同的表)表定義的方式,因此它倒是有可能說:
select id from @typed_var.table1 where ...
或
insert into @typed_var.table3(id) values (...)
我有一種感覺,我想就這一個太多,BU t似乎無法在互聯網上找到確定的「是」或「否」。
有沒有可能?
我認爲這個問題是有關:http://stackoverflow.com/questions/4626292/how-to-use-table-variable-in -a-dynamic-sql-statement – 2011-07-09 01:14:56
而這篇文章有一些非常有用的東西:http://www.sommarskog.se/dynamic_sql.html#FirstEncounter – 2011-07-09 01:20:22