July 2010
Intermediate to advanced
840 pages
16h 33m
English
While I do not like to spend much time discussing nonstandard SQLlike languages, the T-SQL language from Sybase and Microsoft has a horrible flaw in it that users need to be warned about. They have a proprietary syntax that allows a FROM clause in the UPDATE statement. If the base table being updated is represented more than once in the FROM clause, then its rows can be operated on multiple times, in a total violation of relational principles. The correct answer is that when you try to put more than one value into a column, you get a cardinality violation and the UPDATE fails. Here is a quick example:
CREATE TABLE T1 (x INTEGER NOT NULL); INSERT INTO T1 VALUES (1), (2), (3), (4); CREATE TABLE ...
Read now
Unlock full access