I saw the above 'ANSI warning' message today when running a colleague's script (and I don't know which of the many statements caused the warning to be shown).
In the past I've ignored it: I avoid nulls myself and so anything that would eliminate them is a good thing in my book! However, today the word 'SET' literally shouted out at me and I realised I don't know what the meaning of the word is supposed to be in this context.
My first thought, based on the fact it is upper case, is that it is referring to the
SET keyword and means 'assignment', as in
UPDATE <table> SET ... ...ON DELETE SET NULL... SET IDENTITY_INSERT <table> ON
According to the SQL Server Help, the 'ANSI warnings' feature is based on ISO/ANSI SQL-92, the spec for which makes just one use of the term 'Set operation' in a subsection title, hence in title case, in the data assignment section. However, after a quick Googling of the error message I see examples that are
SELECT queries with seemingly no assignment involved.
My second thought, based on the wording of the SQL Server warning, was that the mathematical meaning of set is implied. However, I don't think that aggregation in SQL is strictly speaking a set operation. Even if the SQL Server team consider it to be a set operation, what is the purpose of putting the word 'set' in capitals?
While Googling I noticed a SQL Server error message:
Table 'T' does not have the identity property. Cannot perform SET operation.
The same words 'SET operation' in the same case here can only refer to the assignment of the
IDENTITY_INSERT property, which brings me back to my first thought.
Can anyone shed any light on the matter?