i'm stacked with the following problem:
From C# I'm trying to feed a store procedure MyStoreProc which has only one entry parameter that is a "TYPE AS TABLE"
my "TYPE AS TABLE" has id as first column which is declared as identity(1,1)
Now, in c# i've created a datatable which has the same number of columns (same header that columns name) that my "TYPE AS TABLE" including
the column for the id that i filled up with integers.
If I call my SP with the parameter which is the datatable , I receive the error:
INSERT into an identity column not allowed on table variables
If I remove the id column from the datatable and I call my SP I receive the error
Trying to pass a table-valued parameter with (X-1) column(s) where the corresponding user-defined table type requires (X) column(s).
how can i manage to call myStoreProc in order no to pass the id ?
thank you in advance for all your ideas, proposals.