I just found an error in one of my programs where I forgot a sentence somewhere. The code was something like this:
declare @foo bigint
declare @bar bigint
select @foo = foo, @bar=bar from tbFooBar
where (....a long list of condition goes there)
(... and an extra condition should have went there but I forgot it)
Unfortunately, the where clause, which I forgot, was useful in very specific cases, and the code passed the test successfully.
In the end, the request returned two values instead of one, and the resulting error was a nightmare for tracking (since it was very difficult to reproduce, and it was not at all obvious that this particular stored procedure was causing the problem we noticed)
Debugging would be much simpler if @foo = foo raised an exception instead of silently assigning the first value from several lines.
? , , ( , "" "" - )
SQL Server 2008 , ?