Index: StoredProceduresXml.cst =================================================================== --- StoredProceduresXml.cst (revision 701) +++ StoredProceduresXml.cst (working copy) @@ -162,6 +162,7 @@ // [ab 012605] nonKeys/cols sans computed/read-only columns. This is for Insert/Update operations ColumnSchemaCollection colsUpdatable = new ColumnSchemaCollection(cols.Count); + ColumnSchemaCollection colsInsertable = new ColumnSchemaCollection(cols.Count); ColumnSchemaCollection nonKeysUpdatable = new ColumnSchemaCollection(nonKeys.Count); // Holds the RowVersion column is there's any @@ -172,6 +173,10 @@ if ( ! IsIdentityColumn(column) && ! IsComputed(column) && ! IsRowGuidColumn(column) ) colsUpdatable.Add(column); + //RowGuids are insertable + if ( ! IsIdentityColumn(column) && ! IsComputed(column) ) + colsInsertable.Add(column); + if (column.NativeType.ToLower() == "timestamp") RowVersion = column; } @@ -361,12 +366,12 @@ <%= GetSetTransactionIsolationLevelStatement() %> INSERT INTO <%=fqTableName%> ( - <% for (int i = 0; i < colsUpdatable.Count; i++) { %>[<%= colsUpdatable[i].Name %>]<% if (i < colsUpdatable.Count - 1) { %> + <% for (int i = 0; i < colsInsertable.Count; i++) { %>[<%= colsInsertable[i].Name %>]<% if (i < colsInsertable.Count - 1) { %> ,<% } } %> ) VALUES ( - <% for (int i = 0; i < colsUpdatable.Count; i++) { %>@<%= GetPropertyName(colsUpdatable[i]) %><% if (i < colsUpdatable.Count - 1) { %> + <% for (int i = 0; i < colsInsertable.Count; i++) { %>@<%= GetPropertyName(colsInsertable[i]) %><% if (i < colsInsertable.Count - 1) { %> ,<% } } %> )