passing Record into Table valued parameters
-
- Posts: 5
- Joined: Sat 03 Oct 2009 13:21
passing Record into Table valued parameters
Hi everybody.
How can i pass record type into table valued parameters with TStoredproc?
I'm using SDAC 6.1.4 for Delphi XE2.
Thanks
How can i pass record type into table valued parameters with TStoredproc?
I'm using SDAC 6.1.4 for Delphi XE2.
Thanks
Re: passing Record into Table valued parameters
Hello,
Please read the "Using Table-Valued Parameters" article of the SDAC documentation. It describes the way of using the TMSStoredProc component to work with Table-Valued Parameters.
Please read the "Using Table-Valued Parameters" article of the SDAC documentation. It describes the way of using the TMSStoredProc component to work with Table-Valued Parameters.
Re: passing Record into Table valued parameters
Hello, AndreyZ.
Do I have to install every time new version of SDAC to refresh last documentation? Is there any way to download latest documentation without reinstalling?
Thanks.
Do I have to install every time new version of SDAC to refresh last documentation? Is there any way to download latest documentation without reinstalling?
Thanks.
Re: passing Record into Table valued parameters
You can download the latest version of the SDAC documentation in the CHM and PDF formats at http://www.devart.com/sdac/download.html
Re: passing Record into Table valued parameters
I've got it.
If a stored procedure requires two or more table-valued parameters, should I create and open several TMSTableData instances for each of them?
Code: Select all
MSTableData.TableTypeName := 'DeptTableType';
MSTableData.Open;
MSTableData.Append;
MSTableData.Fields[0].AsString := 'ACCOUNTING';
MSTableData.Fields[1].AsString := 'NEW YORK';
MSTableData.Post;
MSStoredProc.StoredProcName := 'SP_InsertDept';
MSStoredProc.PrepareSQL;
MSStoredProc.ParamByName('TVP').AsTable := MSTableData.Table;
MSStoredProc.ExecProc;
MSTableData.Close;
Re: passing Record into Table valued parameters
Yes.If a stored procedure requires two or more table-valued parameters, should I create and open several TMSTableData instances for each of them?
-
- Posts: 5
- Joined: Sat 03 Oct 2009 13:21
Re: passing Record into Table valued parameters
Hi again.
I'm using TMSTABLEDATA to work with Table-Valued parameter .
When i click on the TableTypeName Drop Down,i get the error "Table Valued parameter is not supported by SQL Server" .
If typing Table-Valued Parameter name in the TableTypeName and avtice the connection,i get the error "Table Does not Exist".
I'm using Delphi 2010 And SQL Server 2012.
Sdac Version is = 6.7.14
Thanks for Advance.
I'm using TMSTABLEDATA to work with Table-Valued parameter .
When i click on the TableTypeName Drop Down,i get the error "Table Valued parameter is not supported by SQL Server" .
If typing Table-Valued Parameter name in the TableTypeName and avtice the connection,i get the error "Table Does not Exist".
I'm using Delphi 2010 And SQL Server 2012.
Sdac Version is = 6.7.14
Thanks for Advance.
Re: passing Record into Table valued parameters
Table-Valued Parameters are supported since SQL Server 2008 and only using SQL Native Client 10 or higher. As you are using SQL Server 2012, the problem occurs because you are using not the correct version of the provider. To solve the problem, you should set the TMSConnection.Options.Provider property to prAuto or prNativeClient. Also, make sure you have SQL Native Client 10 or 11 installed on your computer.
-
- Posts: 5
- Joined: Sat 03 Oct 2009 13:21
Re: passing Record into Table valued parameters
If any other questions come up, please contact us.