views:

351

answers:

2

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.

A: 

As xml (perhaps as nvarchar(max)) would be your best bet, but I've not tried it.

gbn
A: 

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).

Remus Rusanu