question

Fatherjack avatar image
Fatherjack asked

Update whole record or dynamic TSQL in procedure?

I am on a new project and we are looking at having a wide table and I am wondering if anyone has done any measurement of whether it is better to have a procedure to carry out an update from the web app update the whole record or to update just the column being changed? It's a lot easier to write the procedure to update the whole record but that will start to incorrectly skew statistics and be slower if there are lots of indexes, however writing the procedure to check which column value is different and execute the T-SQL to update just that column will be quite complex and potentially sub-optimal? I'm a stranger in developer-land so am not aware of any standards on this ...
t-sqlperformancedynamic-sqlbest-practice
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

· Write an Answer
Kev Riley avatar image
Kev Riley answered
1 comment
10 |1200 characters needed characters left characters exceeded

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Nice one! Thanks :)
0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.