Viewing 15 posts - 31 through 45 (of 71 total)
Only enforcing uniqueness by an identity column PK is my No. 1. Simple, but see it all the time and the disastrous consequences.
August 23, 2020 at 1:08 pm
Yes, order of processing can differ - rare and not something I had seen before.
https://docs.microsoft.com/en-us/sql/t-sql/queries/select-transact-sql?view=sql-server-ver15
Yellow box warning following the section Logical Processing Order of the SELECT statement:
"The preceding...
February 11, 2020 at 2:38 pm
OK. I ask because I have seen it too, despite the logical ordering of processing that I thought was the last word on it.
https://qa.sqlservercentral.com/forums/topic/select-processed-before-where-clause#post-3696457
February 10, 2020 at 4:03 pm
Out of interest - by 'later', are you saying that the CAST/ TRY_CAST is being executed in the SELECT before the WHERE?
February 10, 2020 at 2:49 pm
AND and OR treat UNKNOWN as FALSE, and the result is what I'd expect from the WHERE clause. But this is not the case with NOT and UNKNOWN. To avoid...
November 20, 2019 at 8:32 pm
Yes, when you re-arrange to that - remove the NOT - the result in 3. makes sense.
I find it difficult to see it with the original: not (a = 1...
November 20, 2019 at 4:42 pm
Yes. It's not about the logical order of processing but an exception to it. Specifically, that a conversion in the SELECT can be executed before the WHERE. I came across...
November 9, 2019 at 9:49 am
Can't post code at moment. The change I made to the WHERE clause returns a subset of the rows that were successfully returned previously. But errors on casting a value...
November 6, 2019 at 7:46 pm
Thanks. Will use the ISNULL to eliminate the final operation. Don't really see the need to go any further as it will probably be wrapped up in a scalar-valued function.
March 23, 2016 at 2:53 am
Ended up with this, that is closer to my actual requirement. Previously used a WHILE loop and counter.
declare @List varchar(max) = '123456789'
declare @ChunkSize int = 3
declare @SepChar char(1) = ','
declare...
March 22, 2016 at 2:58 pm
I see, thanks. As it's scanning the tally table row-by-row from start to the predicate value, the order of N may be important in some cases (not this example), such...
March 21, 2016 at 5:29 am
Thanks, I've used that great article in the past. Most of the examples I've seen for using a tally table return a rowset, such as a CSV splitter. What I'd...
March 19, 2016 at 1:03 pm
Thanks for the confirmation. I do find the terminology confusing: alerts notify you of events, and jobs have notification on the outcome of running it.
November 30, 2012 at 3:59 am
That's fantastic, thanks! Works a treat.
Just changed: CASE WHEN T.N % 5 = 0 THEN 364 + 7 ELSE 364 END
so that it adds on an extra week each 5th...
May 8, 2012 at 1:09 pm
Thanks. My lack of knowledge, I didn't know you could bulk insert into a table with an identity column - I thought that all columns had to match.
January 18, 2012 at 2:27 pm
Viewing 15 posts - 31 through 45 (of 71 total)