1

MS SQL Server supports passing a table as a stored-procedure parameter. Is there any way to utilize this from Python, using PyODBC or pymssql?

2 Answers 2

4

There may be a way to do so using a more API-ey feature, but if all else fails you could just use whatever the API exposes to send raw SQL commands to build the tables yourself and call the procedure, using a query string like the following:

DECLARE @p1 <TableTypeName>;
INSERT @p1 VALUES (<value list...>);    
EXEC usp_Procedure @p1;
Sign up to request clarification or add additional context in comments.

Comments

0

Use IronPython. It allows direct access to the .net framework, and therefore you can build a DataTable object and pass it over.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.