Search notes:

SQL Server - update statement

Peculiarities

Apparently, the update statement does not allow a (normal) alias for table names in SQL Server:
create table tq84_test(a integer);

insert into tq84_test values(  42);
insert into tq84_test values(null);
insert into tq84_test values(  99);

-- Will not work because of alias:
--
-- update tq84_test t set t.a = -1 where t.a is null;

-- Ok:
   update tq84_test   set   a = -1 where   a is null;

drop table tq84_test;
Github repository about-MSSQL, path: /sql/update/no-alias.sql
Apparently, an alias can be given with the following special syntax (for me anyways):
update t
set
  t.a    = -1
where
  t.a is null
from
  tq84_test t;

Index