Hi, I am using TVP for bulk insert in my SP, following to the example in wiki I found always there is error message ""The type of column 'Comparer' is not supported. The type is 'IEqualityComparer`1'"
Here is my SP
Create Procedure [dbo].[Gatewaypayment_PCD_test ]
(@inGroupID int, @inTvpCategories dbo.CategoryTableType READONLY)
as
insert into Gatewaypayment_CTTest(CategoryID,Weight,CategoryName)
select ct.CategoryID, ct.Weight, ct.CategoryName from @inTvpCategories as ct
My Table and Type Table
CREATE TYPE dbo.CategoryTableType AS TABLE
( CategoryID int, Weight float(6), CategoryName nvarchar(50) )
CREATE table Gatewaypayment_CTTest
(CategoryID int, Weight float(6), CategoryName nvarchar(50))
Here is my json request
{
"inGroupID": 108,
"inTvpCategories": [
{
"CategoryID": 1,
"Weight": 0.15,
"CategoryName": "Peach Blossom"
}
]
}
Here are full error message response
{
"Message": "An error has occurred.",
"ExceptionMessage": "The type of column 'Comparer' is not supported. The type is 'IEqualityComparer1'", "ExceptionType": "System.ArgumentException", "StackTrace": " at System.Data.SqlClient.TdsParser.TdsExecuteRPC(SqlCommand cmd, _SqlRPC[] rpcArray, Int32 timeout, Boolean inSchema, SqlNotificationRequest notificationRequest, TdsParserStateObject stateObj, Boolean isCommandProc, Boolean sync, TaskCompletionSource
1 completion, Int32 startRpc, Int32 startParam)\r\n at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async, Int32 timeout, Task& task, Boolean asyncWrite, Boolean inRetry, SqlDataReader ds, Boolean describeParameterEncryptionRequest)\r\n at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, TaskCompletionSource1 completion, Int32 timeout, Task& task, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry)\r\n at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)\r\n at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)\r\n at DbParallel.DataAccess.DbAccess.CreateReader(String commandText, Int32 commandTimeout, CommandType commandType, Action
1 parametersBuilder, Int32 resultSetCnt)\r\n at DbParallel.DataAccess.DbAccess.ExecuteStoredProcedure(StoredProcedureRequest request, Action1 readAction, List
1& outputParameters)\r\n at DbParallel.DataAccess.DbAccess.ExecuteStoredProcedure[T](StoredProcedureRequest request)\r\n at DataBooster.DbWebApi.WebApiExtensions.ExecuteDbApi(ApiController apiController, String sp, IDictionary2 parameters)\r\n at MocDbApi.Controllers.DbWebApiController.DynExecute(String sp, InputParameters allParameters) in C:\\www\\MyDbWebApi\\MyDbWebApi\\Controllers\\DbWebApiController.cs:line 25\r\n at lambda_method(Closure , Object , Object[] )\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters)\r\n at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary
2 arguments, CancellationToken cancellationToken)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ApiControllerActionInvoker.d__0.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Controllers.ActionFilterResult.d__2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)\r\n at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n at System.Web.Http.Dispatcher.HttpControllerDispatcher.d__1.MoveNext()"
}
Please Help,
Many Thanks.