How to clear a table type parameter

Discussion of open issues, suggestions and bugs regarding SDAC (SQL Server Data Access Components) for Delphi, C++Builder, Lazarus (and FPC)
Post Reply
Posts: 11
Joined: Thu 27 Jun 2013 12:23

How to clear a table type parameter

Post by Nilss » Wed 20 Jan 2016 15:55


when using table type parameters how can they be cleared?

Parameter assignment as in the help file is used:
MSStoredProc.ParamByName('TVP').AsTable := MSTableData.Table;
However, the TMSTableData object is not only closed but destroyed after the stored procedure is executed. This leaves a reference in TMSParam object, which will cause an access violation when stored procedure is prepared the next time.

Calling Clear procedure of TMSParam did not completely reset the parameter, neither did assigning nil to AsTable property work.

SDAC version is 7.1.3 for RAD Studio 7.

Posts: 99
Joined: Sat 18 Aug 2012 08:33

Re: How to clear a table type parameter

Post by LHSoft » Thu 21 Jan 2016 16:10

MSStoredProc.ParamByName('TVP').Value := NULL

Post Reply