0

I have two tables in both tables have a BSONUM column, I need to update table1 column REIS if in both tables BSONUM = BSONUM

made a query in SQL Server but does not work

enter image description here

ariana
  • 33
  • 7

2 Answers2

1

You can do join & always define table alias:

update t
     set t.reis_t = s.reis
from ticket t inner join
     segements s
     on s.bsonum = t.bsonum; 
Yogesh Sharma
  • 49,870
  • 5
  • 26
  • 52
0

Apperently there is ambiguity in the column name BSONUM Have you tried doing WHERE FirstTable.BSONUM = SecondTable.BSONUM

If you have two columns with the same name from two tables the engine has issue understanding which one you are referring to. Thus, you need to specify table name as well.

Milos K
  • 1,009
  • 8
  • 5