Altering SQL Server user defined types with default value still enforce me to pass new column

2

We added a new column to SQL Server user defined table with a default value. So I am expecting the old code to work and use default value but I got an error back from ado.net

System.Data.SqlClient.SqlException (0x80131904): Trying to pass a table-valued parameter with 8 column(s) where the corresponding user-defined table type requires 9 column(s).

_typeSqlMetaData = Create table schema - old table structure
SqlDataRecord record = new SqlDataRecord(_typeSqlMetaData);
record.SetInt16(0, someData);
record.SetGuid(1, someGuid);
record.SetDecimal(2, Amount);
.
.
.
record.SetBoolean(7, someflag); 
c#
sql-server
asked on Stack Overflow Oct 29, 2019 by AGp • edited Oct 29, 2019 by Dale K

0 Answers

Nobody has answered this question yet.


User contributions licensed under CC BY-SA 3.0