« first day (1295 days earlier)      last day (3574 days later) » 
12:00 - 19:0019:00 - 23:00

JNK
7:00 PM
Guid, Isactive INCLUDE (canceldate) may do it
 
I think it'd be guid, IsActive, CancelDate with an include on Amount but I'm
 
JNK
Amount is in the other table right?
 
oh, duh, yes
Hazards of dumbing down queries
 
@Kermit Yeah saw it earlier. Disregarded as irrelevant.
 
JNK
I said include b/c I'm not sure it will be able to filter based on the table scan you gotta run on B
 
7:01 PM
Yes... a phrase about polishing a turd comes to mind
 
JNK
is there a reason you are left joining there?
 
Legacy code
 
JNK
ok
 
I was trying to figure out if I can write it as inner joins here as it's a sub query
 
JNK
And honestly you could simplify it some
I mean not too much but you don't need to check Inactive twice
if you don't get in that first CASE inactive = 0 (assuming it's a non-nullable bit)
 
7:06 PM
If only we could assume that sigh
 
JNK
:()
 
JNK
wipes glasses
your table names are all blurry
 
@billinkc Ug.
 
It so I can say I'm being safe sharing vital seekrits
 
JNK
7:07 PM
lots of NICE THICK BLACK LINES there though
 
The thickest
 
JNK
good to see you're using your IO subsystem to its fullest!
 
We like to tax the 4200 rpm drives to the fullest
 
@billinkc I thought you had some Plan Explorer beta with 3-D and shadows
 
@billinkc dats thick
 
JNK
7:08 PM
@AaronBertrand doesn't that require a GPU
 
If only we knew the secret table names our queries could suck as much.
3
 
@JNK yes I believe so
 
JNK
is this query the one with the CI scan?
the one you showed us I mean
 
Yes, this is the full nastiness
to be honest, the whole data model is a mess
 
Really.
 
JNK
7:09 PM
im a little concerned about the 16m rows flowing up from the bottom right too
it's apparently immune from any of the filtering or operations on it
 
If you didn't see my tweets yesterday about running sp_blitzindex on it, it was ummmm amusing.
 
JNK
I'd say burn it with fire the degauss the data center
 
Put it in a dress and apply lipstick. Best chance you've got of getting a pretty result.
 
@billinkc looks like the one that I just finished optimizing
 
JNK
you guys haven't seen shitty exec plans
 
7:12 PM
I beg to differ.
 
JNK
I had a view that parsed millions of very large XML documents
(not you Paul)
 
621 tables in production, 513 report back that they have wide clustered index (> 3 columns OR > 16 bytes)
 
@JNK Why! For the sake of cute fluffy bunnies, why?!
 
So many tools, not enough shells for my sawed-off
 
JNK
I kid you not it was a perfect Isosolese triangle with about 1000 nodes
 
7:13 PM
I've been saving my stars for Aaron.
 
JNK
lol
 
w00t!
 
JNK
@billinkc yikes
 
@JNK Yeah, there is a table with > 30 NCIs
 
@billinkc You either enjoy a challenge (= lost cause) or they're paying you enough to retire in 6 weeks.
 
JNK
7:14 PM
@billinkc Supar Optahmized
 
They recognize their design presents challenge to scalability. But between now and the rewrite, I'm saddled up and will not lack for tiltable windmills
2
 
Hm. I can't seem to load sqlperformance.com right now, but downforeveryone claims it is up.
I can ping it
 
@PaulWhite works for me
 
Bah. But thanks.
 
sigh this answer
0
A: How to retrieve all matching records

Robert SheahanThe trick is to build a correlated subquery where you get a list of subjects that the student in question hasn't taken DECLARE @N TABLE(NID INT, NName varchar(10)) DECLARE @C TABLE(CID INT, CName varchar(10)) DECLARE @E TABLE(NID INT, CID INT) INSERT INTO @N VALUES(1,'John'),(2 ,'Matt'),(3,'Smit...

 
7:23 PM
interesting ... i have one set of queries that go from ~1 minute runtimes to ~100 minute runtimes with the new CE in 2014 but only with a cold cache. warm cache results return the expected improvement with the new CE.
 
@bluefeet that's terribad
 
@PaulWhite I have an open ticket, it may be regional - works for me but not for Kevin in Tennessee.
Haven't heard info yet about how deep it goes - pretty sure it is affecting a large number of customers.
 
@bluefeet "And thanks Bluefeet, that formatting does look nicer :-)" aww he likes you.
 
It's intermittent here. Worked long enough for me to do what I wanted. Going to sleep now, no doubt all will be well by the time I wake up. Thanks for the info.
 
@Zane he probably doesn't know I'm a mod, otherwise it would be all hate
@Kermit another terribad answer - stackoverflow.com/a/24895103/426671
 
7:36 PM
@bluefeet "Tell me how to format my code you effing mod!"
 
@AaronBertrand ... down in denver, too
 
and Phoenix
 
(which is Denver's little sibling)
 
@swasheck as Phx is the sibling to LA
trickle down
weirdness
0
Q: T Sql Column only fills with null

PCSgtLOur team had an issue where an Insert into Table2 Select * from Table1 Did not fill specific columns. We tested several times. Select * from Table1 All the data was present. Truncate Table2 Insert into Table2 Select * from Table1 The same specific columns where not filling. The rest of...

going to report a SQL Server bug
:)
 
sqlperformance.com is fine in Kansas City
 
7:39 PM
@AaronBertrand sqlperformance.com is back up and running with highly performant responsiveness in denver
2
 
I think they missed the point of the question
0
A: T Sql Column only fills with null

BradYou should really be explicitly stating what columns go where and definitely not using a Select * on an Insert Insert into Table2(column1, column2, column3) Select column1, column2, column3 from Table1 now you KNOW Table1.Column1 maps to Table2.Column2

 
Doesn't seem to be much interest on ServerFault -- possibly worth migrating?
0
Q: How can I verify whether a Windows cluster has previously been successfully validated?

JamesAs part of an automated SQL Server installation process, I'd like to programmatically check whether a Windows Failover Cluster has already been validated. There are some ways to validate the cluster programmatically, such as the Powershell cmdlet Test-Cluster, but I haven't been able to find a w...

 
Could you perhaps post the columns so we have some clue as to what's going on? At the moment we are kind of forced to take your word for it which make it impossible to see what's happening and help you out. The results of selecting from table 1 would help as well. — Zane 14 secs ago
SQLPerformance still has love for MSP.
 
@Zane these highly performant cities are lucky
 
@bluefeet well if he was typing out his inserts like that we would at least have some clue as to what he's doing wrong.
 
7:43 PM
@Zane meh I like to use INSERT INTO SELECT * :)
less typing
 
I don't blame you carpal tunnel can be a bitch.
 
I also like to do it because I know if @AaronBertrand ever sees the code his head will explode.
 
If he drops by SO his head must explode like 4 times a good day.
@PCSgtL tweaked how?! Post what these tables look like or we will not be able to help you. — Zane 7 secs ago
I give up that guy is a knob.
 
@Zane I closed the question. If they can't provide enough details, it's a waste of time
 
1
Q: How do I include nulls during comparisons in SQLServer?

Brian T HannanSo basically in SQLServer a NULL means there is no value and thus can't be compared which returns some unexpected results. For example, the following query doesn't return rows where value IS NULL but I want it to: SELECT * FROM table where (value != 26) and date IS NULL and last_m...

@bluefeet Can we migrate that and merge with the copy on dba.se? It has an accepted answer here.
 
7:58 PM
Yup his update was useless I give up.
 
so much for sleeping, eh @PaulWhite?
 
I was distracted at the last moment...
 
i dont like using parentheses. i mean ... c'mon ... order of operations isnt really maths, right? why can't the parser just read my mind instead??!!!???!!!
 
@PaulWhite migrated here @AaronBertrand can you merge?
 
@bluefeet Thank you!
 
8:02 PM
@PaulWhite np
 
Merged. That was fast.
 
Why on earth do I have to go and get the URL and paste it to merge? I can only merge the question that it has been closed a duplicate of.
So it seems to even bother prompting me for that information is just busy work. And it's annoying because I have to lose the dialog and start over.
 
It's to ensure heapers have a chance to notice the close as dup before the merge.
 
JNK
@AaronBertrand yeah that's pretty obnoxious
 
anyone know the Ctrl + command to Increase Font size in SQL Server.
 
8:12 PM
@Zane numberpad + ?
 
I hit it on accident while going for ctrl+ S
 
JNK
yeah ctrl +
you can also hold ctrl and use mouse wheel
 
ctrl shift .
 
Thanks!
I just wanted to UNDO!
 
8:39 PM
I don't understand don't understand don't understand — Kermit 6 secs ago
 
9:29 PM
this is hurting my brain
COALESCE(csn.OrgUnitID,NULL)
 
@bluefeet seriously?
 
@Lamak yes
0
Q: Why does this CTE give the error Conversion failed when converting the varchar value 'Actual' to data type int

CraigBobI've got this CTE and it's giving me fits. I'm getting the following Error which I can't track down. Conversion failed when converting the varchar value 'Actual' to data type int. The problem is I have no column in any table called Actual. I'm not even sure where to begin. I've tried breaking t...

 
wow
 
i like punking the cardinality estimator hard ... therefore i COALESCE(x,NULL)
 
what's the point of COALESCE(m.ModalityID,NULL)? COALESCE is used to replace null with another value - right now you are replacing null with null. — bluefeet ♦ 1 min ago
makes total sense to me
 
9:38 PM
@bluefeet: maybe it's just a placeholder for a value OP doesn't know yet, but it doesn't hurt and is not the reason for the issue, is it? — Tim Schmelter 3 mins ago
^This comment is dumb.
Placeholder for what?!
 
@Zane there are so many things wrong - DISTINCT and GROUP BY
I attempted to respond nicely
@TimSchmelter I'm just pointing out something in the code that doesn't make a whole lot of sense. We are here to try and help people improve their skills, correct? — bluefeet ♦ 2 mins ago
 
@Zane yeah. i mean i understand the gist of what he's trying to say but it just propagate a bad practice
 
Yeah there are a lot of times where people paraphrase their code but Coalesce(value,NULL) makes no sense.
 
@swasheck I get it to, but I also added another comment offering a suggestion for them to research. It sure seems the person who wrote that query doesn't know what they are doing
 
That would be like if I paraphrased to CASE WHEN Column1 is NULL then NULL else NULL as DumbThingToDo people would think I'm a fucking idiot, and with good cause.
 
9:42 PM
@bluefeet well that's fairly self-evident
 
@swasheck at this point we are just guessing what the problem is
 
Why doe people do this to themselves?
 
i'm really looking for a good VtC reason here. OP is unresponsive
 
DATEDIFF(mm
 
@swasheck where?
 
9:47 PM
 
@swasheck debugging help
 
@Zane: How would I know? Maybe COALESCE(Value,(SELECT SomethingElseWhichIDontKnowYet)). Maybe OP wants to remember that it can be null and must be replaced with something else. I don't know. It just seems to be very unlikely that OP doesn't know the functionality of COALESCE. — Tim Schmelter 2 mins ago
^^Disagree.
 
they haven't provided enough details to accurately answer
 
If one of my devs brought me that query I think it would be time to take them back behind the barn and put them down.
This question appears to be off-topic because it is about debugging a mystery data point that has not been explicated. Needle-in-haystack operation that is incumbent upon the OP to discover and remedy. Without a full dump of the table, we have literally no idea which data point is being forced into an implicit conversion (and failing). — swasheck 52 secs ago
^Correction Needle in a poo filled haystack.
 
9:50 PM
@Zane that should be the standard close reason about the debugging help
 
oh @bluefeet ... i just gave you one to delete ... see if you can find it
 
10:31 PM
@swasheck I see it, but I also see you deleted it
 
12:00 - 19:0019:00 - 23:00

« first day (1295 days earlier)      last day (3574 days later) »