Updating multiple tables in mssql

Posted by / 17-Apr-2020 01:08

Updating multiple tables in mssql

Here’s where the multiple updates in a single query trick comes into play.

Also, since many people asked why bother that much when you can just run the normal queries, you can consider this an experiment to find alternatives.

Dan Guzman SQL Server MVP "Leif Neland" This is not supported in MSsql.

update T1 set (the Updated Value, the Other Value) = (select the Top, the Value from T2 where T2Key = T1ID) Is there a workaround?

So, the best solution would be to make a logfile and then process this file with a cron job.

It’s very easy to do that, but the challenge lies in updating the database.

updating multiple tables in mssql-48updating multiple tables in mssql-14updating multiple tables in mssql-33

The ELSE title is very important, otherwise you will overwrite the rest of the table with NULL.

One thought on “updating multiple tables in mssql”