0
$\begingroup$

In MS SQL Server 2016 I have a table type parameter:

CREATE TYPE dbo.Ids AS TABLE (Id INTEGER NOT NULL);

and a stored procedure:

CREATE PROCEDURE dbo.TableParam  @SelectedIds dbo.Ids READONLY AS
BEGIN SELECT * FROM @SelectedIds; END

In Mathematica I have a selection of ids that I want to pass into the SQL procedure. However, I have not been able to figure out the syntax. The following does not work.

SQLExecute[conn, "dbo.TableParam `1`", {{{5}, {6}, {7}}}]

Any ideas?

$\endgroup$
  • $\begingroup$ Don't you have one pair of braces too much? $\endgroup$ – Sjoerd C. de Vries Jul 3 '16 at 18:23
  • $\begingroup$ @SjoerdC.deVries SQLExecute is expecting a list of arguments with the list of ids being the first item in the list. The real SQL procedure takes a few arguments with one of them being the table type. $\endgroup$ – Edmund Jul 3 '16 at 20:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.