Viewing 15 posts - 571 through 585 (of 1,193 total)
pdanes (2/24/2016)
IX_Podrobnosti_SubPhylum_5000Feb 23 2016 10:51PM7071513285100YESNULL70715
10SubPhylum_5000
NULL07071501
Sorry about the ugly output - if there is a tidy way to post table output, I don't know...
February 24, 2016 at 12:35 pm
TheSQLGuru (2/24/2016)
February 24, 2016 at 10:18 am
pdanes (2/24/2016)
Jacob Wilkins (2/23/2016)
I must have misunderstood you earlier, though. I thought the stand-alone COUNT queries...
February 24, 2016 at 9:45 am
Ah, interesting. Estimating 1240 rows and getting an actual 25 million is certainly problematic 🙂
I must have misunderstood you earlier, though. I thought the stand-alone COUNT queries were performing well,...
February 23, 2016 at 2:34 pm
I wouldn't have expected the EXISTS to perform any better, since that's exactly what the IF (SELECT COUNT...)>0 gets converted to by the optimizer, but it's always good to be...
February 23, 2016 at 7:02 am
IF (SELECT COUNT...)>0 actually gets converted to an EXISTS check by the optimizer. http://blogs.technet.com/b/wardpond/archive/2007/08/27/if-exists-select-vs-if-select-count-1-0.aspx
Like you, I'd still prefer the explicit EXISTS, for clarity if for no other reason.
I wrote up...
February 22, 2016 at 4:26 pm
Alan.B (2/22/2016)
Jacob Wilkins (2/19/2016)
kkilsby (2/19/2016)
February 22, 2016 at 8:31 am
kkilsby (2/19/2016)
Doesn't the SQL DB engine first create a cross join for any query involving more than one table? So performance isn't an issue for a cross join query.
No. SQL...
February 19, 2016 at 9:48 am
g.maxfield (2/18/2016)
SS CommittedSELECT compatibility_level
FROM sys.databases
WHERE database_id=DB_ID();
Your code resulted in compatibility_level 100! :unsure:
Then that's the issue. Even on a 2012 or higher instance, the compatibility level of...
February 18, 2016 at 7:23 am
g.maxfield (2/18/2016)
I tried on SQL 2014 but still got the 🙁
Are you sure the instance you're connected to is 2012+? I know you said you're using SSMS 2014, but you...
February 18, 2016 at 7:07 am
Sergiy (2/17/2016)
Check for existence would do just fine:
select t1.[StockCode],t1.[SalesOrder],t1.[SalesOrderLine],t1.[LotNumber],t1.[Customer],
t2.[ShipDate][/i],
from table t1
WHERE EXISTS (
...
February 17, 2016 at 4:22 pm
You don't have the correct scope for the UPPER.
At any rate, it's simpler to do it the other way around, since you already have the SUBSTRING working. Just take the...
February 17, 2016 at 2:45 pm
Alan.B (2/17/2016)
Jacob Wilkins (2/17/2016)
Alan.B (2/17/2016)
The UpdateDt column in the Users table is DATETIME so I wouldn't expect any datatype conversion issues.
Perhaps... To know for sure check the query plan (the...
February 17, 2016 at 2:41 pm
Alan.B (2/17/2016)
The UpdateDt column in the Users table is DATETIME so I wouldn't expect any datatype conversion issues.
Perhaps... To know for sure check the query plan (the actual query plan,...
February 17, 2016 at 2:34 pm
Typically I would suggest doing formatting at the presentation layer, not the database layer, but if you need to do it in the query, then you can just make the...
February 17, 2016 at 2:22 pm
Viewing 15 posts - 571 through 585 (of 1,193 total)