>>>>If you use select * from myTable where Pk = @Pk, will your update command include PK column?
>>>
>>>No
>>
>>Can you show your sample code - looks like I need to set up several properties for this to work the way I need.
>
>This Select command :
SqlDataAdapter da = new SqlDataAdapter("Select Id, CustId,Method FROM SCHeaders WHERE Id=23 ", conn);
generates:
>
UPDATE [SCHeaders] SET [CustId] = @p1, [Method] = @p2 WHERE (([Id] = @p3) AND ((@p4 = 1 AND [CustId] IS NULL) OR ([CustId] = @p5)) AND ((@p6 = 1 AND [Method] IS NULL) OR ([Method] = @p7)))
>
>Using 'Select *' adds more fields but still doesn't include the PK (Id)
In your case, is the ID column an identity column? If yes, then no wonder. In my case it's a numeric(17) column and not identity.
If it's not broken, fix it until it is.
My Blog