I am using MS SQL 2008 R2 database. I am doing a batch insert of records. However, most of data values were truncated during the insert. It looks like that OA creates a SQL statement based on the length of data (from the first record in the batch) and not based on the length of the field specified in database.
Here is the code taken from the OA context class:
, OpenAccessType = OpenAccessType.Character, IsNullable =
, Length = 100, Scale = 0, SqlType =
Here is the SQL statement generated by OA for the first record in the batch (taken form SQL Profiler).
'@p0 nvarchar(20),@p1 nvarchar(22),@p2 nvarchar(16),@p3 datetime,@p4 int,@p5 nvarchar(24),@p6 nvarchar(10),@p7 nvarchar(9),@p8 nvarchar(61),@p9 nvarchar(17)'
[ETM_Log] ([addressfrom], [addressto], [etm_span_recid], [emaildate], [issuccess], [namefrom], [nameto], [student_id], [subject], [defuserid])
(@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9)
Here is the SQL statement for the second record from the batch:
Thank you for your help.