开发者

How do I pass a table-valued parameter to SQL Server 2008 via EntLib 5.0?

开发者 https://www.devze.com 2023-01-31 01:39 出处:网络
How do I pass a table-valued parameter to SQL开发者_Python百科 Server 2008 via EntLib 5.0?I haven\'t tried to do this but having had a quick look at the EntLib Data block I can\'t see an easy way of a

How do I pass a table-valued parameter to SQL开发者_Python百科 Server 2008 via EntLib 5.0?


I haven't tried to do this but having had a quick look at the EntLib Data block I can't see an easy way of achieving this. You can do it with the SqlClient object, but EntLib doesn't support the Structured datatype that you need to pass the data in as a TVP.

If you are guaranteed never to need anything other than an SQL Server backend then I suppose you could cast your connection to a SQLServer-specific one and then use SqlParameters, but that would be defeating the purpose of using the EntLib somewhat.


Good Luck... http://msdn.microsoft.com/en-us/library/bb675163.aspx quote:

Limitations of Table-Valued Parameters

There are several limitations to table-valued parameters:

You cannot pass table-valued parameters to CLR user-defined functions.

Table-valued parameters can only be indexed to support UNIQUE or PRIMARY KEY constraints.
SQL Server does not maintain statistics on table-valued parameters.

Table-valued parameters are read-only in Transact-SQL code.
You cannot update the column values in the rows of a table-valued parameter and you cannot insert or delete rows.
To modify the data that is passed to a stored procedure or parameterized statement
in table-valued parameter, you must insert the data into a temporary  table or into a table variable.

You cannot use ALTER TABLE statements to modify the design of table-valued parameters.
0

精彩评论

暂无评论...
验证码 换一张
取 消