W
W.G. Rowland
I'm fairly new to SQL Server, and I've been using Visual Studio to help
generate some SQLCommands to make life easier. The Insert, Delete, and
Select Commands it produces all seem fairly straightforward, but I'm
wondering about the Update Commands it generates.
Basically what it seems to do is generate an Update command with parameters
for each property, and then a second parameter for each property in the
Where clause.. So to update a record, it would expect you to enter every
column value of the record to be updated, and then all the new values as
well..
In my case I will always be using the unique identity column to select which
record I'm going to update, and I'm wondering if there's any reason (such as
some effeciency issue in SQL I don't know about) to requre my code to supply
every property in the where clause, or if I could just trim all the extra
parameters and have it simply update record WHERE ID=@parameterID..?
Thanks in advance,
William Rowland
generate some SQLCommands to make life easier. The Insert, Delete, and
Select Commands it produces all seem fairly straightforward, but I'm
wondering about the Update Commands it generates.
Basically what it seems to do is generate an Update command with parameters
for each property, and then a second parameter for each property in the
Where clause.. So to update a record, it would expect you to enter every
column value of the record to be updated, and then all the new values as
well..
In my case I will always be using the unique identity column to select which
record I'm going to update, and I'm wondering if there's any reason (such as
some effeciency issue in SQL I don't know about) to requre my code to supply
every property in the where clause, or if I could just trim all the extra
parameters and have it simply update record WHERE ID=@parameterID..?
Thanks in advance,
William Rowland