I sometimes need to run basic updates for the connection. For instance:
UPDATE t1 SET col1 = 'val1'
FROM table1 as t1
INNER JOIN table2 as t2
ON t1.ID = t2.t1_id
WHERE t2.col3 = 'val3'
This works fine, but for some reason in MS SQL Management Studio Express he wants to convert it to
UPDATE t1 SET col1 = 'val1'
FROM table1 as t1
INNER JOIN table2 as t2
ON t1.ID = t2.t1_id
CROSS JOIN t2
WHERE t2.col3 = 'val3'
For some reason, it adds a cross join that I don't understand.
Now my question is: why does Management Studio think that this is what I had in mind? It must have genuine application, otherwise he would not offer it. But I have no idea how and when (and why).
source
share