Is there some way to pass a table-valued parameter to a stored procedure in SQL Server via classic ADO?
Classic ADO is COM and OLE and the SQL Native Client supports Table Valued Parameters over OleDB, see Table-Valued Parameters (OLE DB). One would have to get its hand dirty and code straight to the OleDB interfaces (in C/C++).
Also TVPs are only in SQL 2008, so you won't be able to use them in SQL 2005.
BTW, for completness here is the Table Valued Parameters (ODBC) reference, for the ODBC nostalgics out there...
I thought they were new in 2008?
Anyway, I think the answer is going to be no, I doubt there's a DataTypeEnum value that you'll be able to bend to your needs.
So if I may suggest an alternative, I guess what you want to do is pass some sort of structured data into the stored procedure. I have done this before in ADO using XML:
I know it's not what you wanted, but it's a method that works
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With