Page 1 of 1

Procedure with table-value parameter

Posted: Fri 18 Jan 2013 08:52
by keiichi
Hello

I have stored procedure with table-value parameter. Procedure and table type are defined in a schema other than dbo, ie. myschema.myproc and myschema.mytype.

Code: Select all

Items := TMSTableData.Create(nil);
Items.Connection := SomeConnection;
Items.TableTypeName := 'myschema.mytype';
Items.Open;
Items.Append;
Items.Fields[0].AsString := 'abc';
Items.Post;

Proc.ParamByName('tableparam').AsTable := Items.Table;
Proc.ExecProc; // Error
On execution I get error: Column, parameter, or variable #1: Cannot find data type myschema.mytype.

When I set TableTypeName property as 'mytype' (without schema name) i can succesfully execute procedure, but in this case mytype cannot exist in more, then one schema. If it does TMSTableData object contains fields from types from all schemas.

Also Delphi designer lists and saves to .dfm file table-value types without schemas (TMSTableData component, TableTypeName dropdown list).

I use SDAC v.6.6.11, Delphi XE2 Update 4 HotFix 1 and SQL Server 2008 R2.

Re: Procedure with table-value parameter

Posted: Fri 18 Jan 2013 09:34
by AndreyZ
Hello,

Thank you for the information. We reproduced the problem and the investigation is in progress. We will notify you when we have any results.

Re: Procedure with table-value parameter

Posted: Mon 11 Feb 2013 16:23
by AndreyZ
We have fixed the problem. This fix will be included in the next SDAC build.