简体   繁体   English

如何将SQL临时表传递给C#存储过程

[英]How to pass a SQL temp table to a C# stored procedure

What's the best way to pass a temp table to a C# stored procedure (SQL 2008)? 将临时表传递到C#存储过程(SQL 2008)的最佳方法是什么? Am I stuck passing the temp table name as text and running a select from C#? 我是否一直将临时表名称作为文本传递并从C#运行选择?

I was hoping to use Table Value Parameters, but they don't appear to be supported in C# sprocs. 我希望使用表值参数,但C#sprocs似乎不支持它们。

作为xml(也许nvarchar(max))是最好的选择,但我还没有尝试过。

You are correct, TABLE type parameters are not supported Mapping CLR Parameter Data . 您是正确的,不支持TABLE类型的参数映射CLR参数数据 You have other options though, eg. 您还有其他选择,例如。 pass state as a BLOB ( SqlBytes ) or as XML ( SqlXml ). 以BLOB( SqlBytes )或XML( SqlXml )的形式传递状态。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM