I have a table "Country" with this schema:
CREATE TABLE [dbo].[Country](
[Country] nchar(2) NOT NULL,
[Name] nvarchar(50) NOT NULL,
CONSTRAINT [PK_Country] PRIMARY KEY CLUSTERED
(
[Country] ASC
)) ON [PRIMARY]
When the Step 4 (update) unit test is generated for this table, it tries to put a 3-character value in the "Country" field. It does this because the RandomString function in CommonSqlCode.cs has this near the end:
if (column.IsPrimaryKeyMember && !IsIdentityColumn(column) && !IsComputed(column))
return string.Concat(result, Guid.NewGuid().ToString("N").Substring(0,2));
Thus, it's always returning a 2-character string. The UpdateMockInstance function generated by the unit test creation code appends a "2" to whatever comes back from RandomString, thus creating a 3-character string, which causes the unit test to always fail.
On a side note, the RandomString function generates a string of length ((size / 2) - 1), where size is the # of characters in the column. In the case of a nchar(2) field that is NOT the primary key, RandomString will always return an empty string.