SQL Server: table variable used in a inner join

前端 未结 5 947
无人及你
无人及你 2021-01-01 12:18

What is the problem with following SQL. Can table variable not be used in JOIN clause?

Error msg is of \"Msg 170, Level 15, State 1, Line 8 Line 8:

5条回答
  •  春和景丽
    2021-01-01 12:43

    Change your last statement to:

    UPDATE t1, temp
    SET t1.SportName = temp._SportName
    FROM tblSport AS t1
    INNER JOIN @t AS temp
        ON t1.Lang = temp._Lang
    

    (need to check exact syntax)

提交回复
热议问题