简体   繁体   中英

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)? Am I stuck passing the temp table name as text and running a select from C#?

I was hoping to use Table Value Parameters, but they don't appear to be supported in C# sprocs.

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

You are correct, TABLE type parameters are not supported Mapping CLR Parameter Data . You have other options though, eg. pass state as a BLOB ( SqlBytes ) or as XML ( SqlXml ).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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