« first day (1325 days earlier)      last day (3547 days later) » 
00:00 - 17:0017:00 - 00:00

12:55 AM
@mmarie Glad it helped! The more people we get to stop using that crappy syntax, the sooner we can forget it ever existed...
 
1:21 AM
You could read a book, like Grant Fritchey's free eBook on SQL Server Execution Plans. This isn't really a good format for questions here, since someone could literally paste the entirety of that book as an answer. What would be the point of that, when you could just go read the book directly? Tons of other resources out there too. Try a search engine. This isn't a "do my research for me" site... — Aaron Bertrand 3 mins ago
 
It's actually kind of sad how often we link to that blog post.
 
I need to add an entry to my hosts file: 127.0.0.1 stackoverflow.com
Or get my service provider to block it. What a f*hole full of f*holes.
 
@AaronBertrand speaking of that book. What's the deal with tech book covers? They always seem to be completely random.
 
The problem is we leave that in the hands of designers
What do either of those covers have to do with tech? Your guess is as good as mine.
 
Good grief I need a better rig.
My SQL Server and SSDT install is taking ages.
 
1:33 AM
I have pretty good gear and yesterday applying a CU to an Express instance took about 20 minutes. I don't know what kind of shit Windows does under the covers but I don't like it.
Come on you know you want to vote for this
Connect is slow as balls as it is, this would really help
Why do you need to do this with a CTE? There are better ways (look at the perf of the CTE approach compared to other methods). — Aaron Bertrand 28 secs ago
I feel bad now because I gave the same guy crap the other day for blogging about how cool it is to use Powershell to call sp_who2 (using 20+ lines of code and comments).
 
1:49 AM
@AaronBertrand Eh. If someone's being stupid, call them on it. Concatenation by recursive CTE seems like a remarkably bass-ackwards way of doing it
Also people self-answering questions that are leading people down bad paths doesn't really sit well with me. i.e. the question should be more "how to do something in SQL Server", not "how to do something (using specific-technology-that's-not-really-well-suited-to-the-task) in SQL Server"
 
2:40 AM
@AaronBertrand voting is not enabled.
 
 
2 hours later…
5:00 AM
How can i add ''nt authority \network service'' user into Windows authentication?
 
 
3 hours later…
7:35 AM
good morning
 
7:56 AM
bhelo
helo
hey i have a question
 
8:19 AM
@BlueBerry-vignesh4303 That would be a good question for ServerFault. If you create a question there with some more details about what you're trying to do, I can answer there.
 
8:41 AM
Morning all
 
9:08 AM
Morning
 
10:00 AM
You could avoid the WithMax step by just adding a COUNT(*) OVER (PARTITION BY C.State) to NumberedCounties. But really, if you feel this can be useful despite the fact there are better concatenation methods, why don't you elaborate on why (as in "give an example where using this particular method is preferable"). — Andriy M 1 min ago
 
10:56 AM
On SQL Server 2012 and up, is there a way to know the amount of rows returned so far in a running query?
 
11:19 AM
@Gonsalu row_count in sys.dm_exec_requests?
 
@PaulWhite Thank you, Paul, that's exactly it
do TCP keep-alive packets reset the ASYNC_NETWORK_IO waits for a session?
I have this query (running on a SSIS package) that only returned a single row, and has the thread on node 0 waiting for ASYNC_NETWORK_IO, but it never seems to exceed 2s...
OK, that doesn't make any sense, because there's examples of ASYNC_NETWORK_IO having much higher wait times that a typical TCP keep-alive interval. Now I'm puzzled on why this is happening...
 
11:42 AM
An ASYNC_NETWORK_IO wait in SQL Server usually indicates SQL Server is waiting for the consumer of the rows to accept more data.
 
yes, I know that that's what's happening, I just would expect to see something different in the DMVs
Imagine a simple SSIS package, with a source reading from table A, and inserting into table A (without the table lock option)
 
Reading from and inserting to the same table?
 
yes, I know it's wrong; I didn't do this haha
I know its deadlocking itself in SSIS
I just want to understand this, because I'm not seeing in the DMVs what I thought I would
the source returned a single row so far, after 6h; the estimated plan is to return 6000M
the session for the source query has 8 threads, 7 waiting on CXPACKET to node 0, 1 waiting on ASYNC_NETWORK_IO
but as I run sp_whoisactive every second or so, I never see the waits on ASYNC_NETWORK_IO exceeding ~1.8s
 
Seems odd, I agree.
 
another thing that I would expect, is the session for the insert waiting for a lock on the table or something... it's a sleeping session with lastwaittype on sysprocesses "MISCELLANEOUS"
the source has a granted IS lock on the table
 
11:52 AM
What's in the SSIS package?
Any blocking operations?
 
@PaulWhite nope
 
So what is in the package? More than a source and destination, I presume?
 
it's a fact load, so a source, lot's of lookups and a destination, basically
the cmd column from SYSPROCESSES for the insert session has "AWAITING COMMAND"
I don't know what that means, to be honest
 
Is it possible the lookups are still trying to load their reference data? If one were blocked that might explain what you're seeing. Awaiting command basically means the insert hasn't started yet.
 
doesn't the source query run only after the lookups' reference data has been loaded?
 
12:06 PM
No idea.
Might depend on how the lookups are configured.
Besides, the source session indicates it has sent 1 row, which seems like a suspiciously low number e.g. might be the result of some single row SELECT the source component issues before the full read gets underway. What does DBCC INPUTBUFFER show for the source connection?
 
JNK
morning all
 
Good morning
 
JNK
or evening for @PaulWhite
 
It just turned morning 12 minutes ago :)
 
JNK
technically morning
Yeah you're 14 hrs ahead of me
 
12:12 PM
Yep it's Friday all of a sudden
 
JNK
"Hello from the future!"
I like those Tokyo-LAX flights that are 10 hours in the air but you land 6 hours before you took off.
 
Very similar from here. The box above shows flights AKL -> LAX
Arrive 7 hours before leaving after a 12 hour flight.
 
JNK
coming back is a pain I'm sure
you lose a whole day
 
Yes.
The only solution that makes sense.
 
12:38 PM
@PaulWhite sorry, didn't get to run it, the package finished before I could run it...
which is really weird by itself, because I get row_count of 1 and then the package finished, inserting like 400k rows
I'm puzzled by this, and now I can't dig into it because the package already finished :\
@PaulWhite thanks a lot for the help, tho!
 
400k rows is a lot less than the estimate. Shouldn't that package run in a few seconds rather than 6 hours?
I'm sure you'll get to the bottom of it.
 
@PaulWhite It usually takes 15 minutes to run. The difference from estimate to actual is because of a mis-estimate on the output of a JOIN hash-match
 
Just seems like a long time to process 400k rows through a bunch of lookups.
 
@PaulWhite it's using a lot of conditional splits and union all tasks due to this inferred member pattern they're using, and the rows are pretty wide (WSTR all over).
but yes, I agree it's taking more time than it should
 
12:57 PM
@PaulWhite Can you imagine the disruption to the world economy if that ever gets invented? No more cars, no more trucks, no more trains, planes, gasoline, ships, and all the resources necessary to build those things?
I say bring it!
 
JNK
@MaxVernon I don't think it would be THAT disruptive
new technology is always always prohibitively expensive
 
true enough
 
JNK
People thought cars would kill trains and planes would kill both
You have to imagine that something like a teleporter will need some dedicated transmission lines or something initially
and won't be something every person can have in their home
 
@JNK In my country, people thought so of mobile phones at some point.
 
I kind of liken it to the invention of radio communications. No one ever thought you'd be able to instantly communicate around the world, however it clearly was possible and only took around 100 years until we are able to communicate massive amounts of data over very large distances. I imagine something like a tesseract that can fold space or something very bizarre that doesn't need a huge amount of power. One can only hope I suppose.
 
1:06 PM
It wouldn't matter how expensive they were. One could always profit by using one to break into a bank vault.
Or more simply teleport the cash out.
 
exactly. And that is the most likely reason it'll never happen.
 
JNK
I imagine if they exist it will be like a phone
You need to have a device at each end and initially a special cable running between
eventually it may get to the point that it works wirelessly
 
Teleporters and replicators would break the whole world's economic model. Arguably for the better.
 
@PaulWhite That, and time travel, too. Although maybe not so much for the better.
Time travel would negate the need to optimize query results for instance.
You'd just start it running, and travel into the estimated point in time where the results are, and presto.
 
@MaxVernon You'd still have to travel to the past at some stage to get any benefit though, right?
 
JNK
1:14 PM
can I ask you guys a replication question?
(transactional)
 
No. Never.
 
JNK
CRAP
 
Optimism: looking to interrupt a conversation about time travel with replication.
 
JNK
We have a push replication setup with one sub
 
See above.
 
JNK
1:15 PM
:~( QQ
 
Replication never ends well for anyone.
 
JNK
oh I know
 
@PaulWhite But we don't have a time travel machine to know that for sure.
 
JNK
this thing has broken once in the last month and I had to stay up all night to fix it
 
@AndriyM Ha!
I can sort of imagine how time travel to the future would work without gross paradox, but travel to the past seems to require multiple universes, which might well be physically consistent, but hardly useful.
Maybe if we travelled far enough forward there would be a version of replication that ever caused anything aside from pain.
 
1:20 PM
@PaulWhite I can only imagine traveling forward. Backward appears much more difficult to comprehend. Also, if travel backwards were possible, surely we'd see travelers from the future?
 
Even if you could only view the past, it might still be more harm than help. Was it Isaac Asimov who likened the idea with that of living in aquarium? (in one of his stories)
 
@MaxVernon Not if when travelling backward you always arrived in a different universe, one from an infinite number.
 
sure. 10th Dimension type stuff. Imagine how many wives one could have.
 
It just seems useless to me since you would never get back to the original.
So travelling back with this week's Lotto result would land you somewhere those numbers didn't win, for example.
 
JNK
turns out The DBA™ buggered up adding a table to replication!
wonderful
 
1:24 PM
@JNK Stoooopid DBAs :-)
 
The answer to your questions is always the same.
 
JNK
@PaulWhite me?
 
@JNK Yes, it's always The DBA.
 
JNK
I feel like a broken record
it's ridiculous
 
Entertaining for us though :)
 
JNK
1:25 PM
ALL he did last week was work on this SSIS package that I had already finished and tested
he just needed to add one more table to the load (with 2 whole columns) and push it
 
popcorn
 
JNK
He keeps telling me how he's a SSIS expert
 
LOL
 
JNK
then it takes him 2 full days to get it to where I had it in the first place
He comes to me all excited "I got it loading in QA!"
 
Why doesn't he just use yours?
 
JNK
1:26 PM
I said "Yeah, it was doing that a month ago..."
@MaxVernon he is but we needed to change it slightly
basically I was gonna change a fact table but it's too big to change
so we are adding a lookup table for the column I was gonna add
So he had to add this table to replication and then get the job set up
the table we are replicating has no data yet which is why we are doing it now, so it's ready when it starts getting loaded
 
None of this will matter once we have transporters, replicators, and time travel.
 
JNK
So today I check and the table is empty on the subscriber
...because he added it to the pub article list but didn't reinitialize that article
I'm not even sure the SSIS works yet but we will see I guess
 
ahhh I see. He's an "expert".
 
JNK
he had to work on it like twice more becuase he messed up some variables
 
To be fair, replication is one big gotcha.
2
 
JNK
1:28 PM
no kidding
it's turrible
 
sp_addarticle @pleasejustwork = 1;
 
JNK
@MaxVernon look back in the chat history for The DBA™
I have about a years worth of stories now
 
You'll write a bestselling book based on those and retire early.
 
JNK
I might
A companion to BOFH
 
I'd love to, but then I'd have to wade through all the bits and bobs about the English members going out for drinkies all the time, making me envious.
@JNK BDBAFH
 
1:30 PM
"English members" snerk
 
lol
 
morning
 
good morning oh exulted blue wonder.
 
morning
 
(see what a mod star gets you?)
 
1:32 PM
Uh oh, guess I pissed someone off. What will I ever do without that 10 rep???
 
@AaronBertrand SO?
 
@AaronBertrand oh noooooooooes!
 
@bluefeet yep, I'm sure it will be reversed
 
@AaronBertrand thanks for that tip about CONVERT. I hate using CONVERT for date time conversion since the possible output formats SUCK SO MUCH. Hence I shy away from that sucker. Glad to know I can use to convert binary values for comparison purposes.
 
So you use CAST to convert date times, because it has ZERO options?
 
1:34 PM
SHUTUP! lol
 
Convert is great because for example if your strings are dd/mm/yyyy you can just use style 103. With cast you have to use things like SET DATEFORMAT, ugh
 
I use cast because I don't have to think about it. Most of the time. And typically I don't actually cast datetimes to varchars, shudder
I really like the Format() function so much better. It just works the way I want it to. Having said that - I almost always do the conversion in the front-end code, where it should be done
 
@MaxVernon so just along the lines of my consistency argument, when you don't need the style parameters, you don't have to use them. When you do need them, I find it much easier to add ,103 than to re-write a cast as a convert. Not a big deal either way, but I don't see any advantage to using CAST only in the cases where you don't need convert.
@MaxVernon FORMAT() is pretty but it is extremely expensive.
 
99% of the time, CAST is only used to convert stuff into a varchar for sp_executesql (by me)
 
I honestly don't recall the last time I used CAST.
Oh now I do. It's right there ^
 
1:38 PM
ok you guys have CONVERTed me.
 
Sweet!
 
Using CAST and COALESCE will make your migration from SQL Server to <alternate database product> 0.0000000000000000000000000000000000001% easier.
 
I feel a religious experience coming on. Oh, no that's the coffee.
 
I need a blog post on cast vs. convert
 
@AaronBertrand I'd certainly read it.
How can I explain to this guy that his data just isn't what he thinks it is?
 
1:47 PM
@AaronBertrand fixed ur problem you mentioned earlier
 
@bluefeet ooh, interesting
 
anyone need sexy corsets?
-1
A: SQL schema design: many-to-many relationship trouble while fetching data

tom sayerwholesale sexy corsets from online store.many diffirent quility shoes.so visit the website. http://www.tidestore.com/Wholesale-Sexy-Corsets-100496/

 
@bluefeet does the person who did that get a nasty-gram?
 
@AaronBertrand ;)
when it's obvious yes
only did something because we weren't sure it would all be caught by the script
 
Because two were questions and three were answers?
 
1:54 PM
the spacing between the votes
 
looks like I'm not going to get my T-Shirt (not enough have been sold!?!?!)
 
on another note Gordon is going to get 200k rep this week
 
He's kind of a tool but he does spend a lot of tireless hours answering lots of stupid questions, and generally doing it quite well. :-)
2
 
He has a pretty low score per answer though. Considering he has 13k+ answers
you'd think his rep would be significantly higher
It's really sad when you struggle with writing a stored proc for almost a week and your boss solves it in a few hours :(
Sure makes me feel dumb
 
I've warmed to Gordon a bit.
Though at current exchange rates 200K SO rep ~= 0.76 dba rep.
 
2:09 PM
Ha
 
@PaulWhite I just ignore him
 
Is @Mikael here?
@Zane weird
 
Just say xml three times.
 
@PaulWhite kinda like pivot for me
 
Yes :)
 
2:12 PM
my answering has fallen off a bit
too much mod work
 
@MaxVernon how do you know we don't? They've probably been given strict instructions to not tell us, not change anything, etc.
How did someone create a Connect item with 0 votes?
At one time you could down-vote your own item (say, this is a bug but I don't think it's worth fixing, just document it), or abstain, but now it automatically votes for you on creation.
And you can't undo the up-vote - you can only change it to a down-vote.
 
2:35 PM
@bluefeet They are gone.
@AaronBertrand does anyone else have to ability to vote on that?
 
@Zane either that or nobody else has seen it
 
@Zane someone posted this twice
 
I can change my vote, but I own the thing, so maybe that's why.
 
since it was a question about thumbnails
 
he he.
 
2:36 PM
@Zane I think you have to join that Connect program to vote etc. It's separate from the SQL Server connect.
 
needless to say the answers didn't go over very well
 
@AaronBertrand I see.
 
(I've just always been there because Connect has always been terrible. Even before it was named Connect, we had Ladybug.)
 
he. Lady bug really?
 
"Don't do this again," says a mod. They ignore, and... "This account is temporarily suspended..."
 
2:39 PM
?
 
@Zane The user who liked posting thumbnails
 
@AndriyM yup
if you don't listen
 
This seems like a good example of answering a barely coherent question: asktom.oracle.com/pls/apex/…
 
I have to keep posting don't you see how funny this is!
 
@Zane we don't like fun
 
2:55 PM
Still surprised I haven't taken a ban yet.
 
@AaronBertrand point taken!
 
@Zane I can take care of that, if you'd like?
 
@AaronBertrand I am now...
 
Keep me more focused on work.
I feel I need to earn it though.
 
@Zane working on your SQL Sat KC presentation yet?
 
3:01 PM
Just got my home server running.
 
@Zane what OS you running?
 
Windows 7
 
@Zane i use WHS 2011
@JNK happy work anniversary!
 
@Kermit This is on my crappy old laptop
 
3:06 PM
@Zane you're running a server on a laptop? nice
 
@Kermit It's what I've got. It will work for Demo.
 
JNK
@Kermit thanks!
it was a few weeks back
 
I am incredibly poor @Kermit
 
@MikaelEriksson I've cleaned out that 0x001A (except in plain text) and that validator thing still doesn't like it. Do I need to entitize 0x001A even in plain text? That must wreak havoc on RSS feeds everywhere?
 
@JNK i'll notify linkedin that their algorithm sucks
@Zane i can't help you there. i can give you a bucket of ice though
 
3:10 PM
@Zane Come work with me. We will pay you more :-)
 
Even if they won't call you
BAZINGA!
 
haha
 
@billinkc dont call me, i'll call you
 
Yeah I never heard back from them.
They missed that call and then slowly backed away from fear of looking foolish.
 
I'm gonna call you. But you can't come by here. Don't you eva, eva, evaevaevaeva come by here, and I call you
 
3:11 PM
@AaronBertrand I use Thunderbird at work and it has been awfully silent for a while from SQLPerformance.com. I think it is OK now but I will check the feed in Thunderbird tomorrow. I will let you know how it goes.
 
(That is a reference to actor Chris Tucker's character in the film "Friday")
 
haha, our recruiter (Josh) is a bit too busy. he actually didn't call me back for a long time when i expressed interest in working there
 
@mmarie The issue isn't pay it's debt. Even when I get my raise it will just increase the debt payback rate. I will still be equally poor. Just out of the hideous shackles of debt faster.
 
@MikaelEriksson I wonder if the validator thing is using a cached version of the page somehow.
 
@AaronBertrand I get another error now "description should not contain target_blank attribute"
 
3:14 PM
@MikaelEriksson I can't fix how WordPress stuffs crap into <![CDATA :-(
 
@AaronBertrand And this description "This feed is valid, but interoperability with the widest range of feed readers could be improved by implementing the following recommendations."
So valid but could be better.
And that is in an old post so it should work now since it worked before.
 
It would appear the fall allergy season in MN started this morning.
 
Remind me to go with my gut on whether I should put the effort into providing an answer.
Thanks a lot @billinkc. I will go over it. I did sthg like this to handle and it seems like its working it. ([Drv DOB] == "0") || ([Drv DOB] == "101") ? NULL(DT_DBTIMESTAMP) : (DT_DBTIMESTAMP)(SUBSTRING([Drv DOB],1,2) + "-" + SUBSTRING([Drv DOB],3,2) + "-" + SUBSTRING([Drv DOB],5,2)) . It handles 0 and 101 effectively and as well as output the right format for DOB. — apariyar 10 mins ago
 
I hate that I don't have BIDS helper.
 
There's a no-install version of it
 
3:21 PM
Really?
 
@billinkc crikey what a nice answer.
 
BIDSHelper2014_1_6_6_0.zip from bidshelper.codeplex.com/releases/view/121231
@MaxVernon Thanks. It's going to be a blog post because I've never had to try and implement the 2 to 4 year boundary logic before in SSIS. Seemed like a fun challenge
 
Good grief I F'ing love plan explorer.
 
I don't. It ridicules all the plans I have.
 
Lol
 
3:25 PM
"ohhh, the optimizer gave up because you couldn't write a query to save your life"
 
the best-laid plans of devs and plebes often go awry
 
@billinkc Thank you for taking the time to produce a comprehensive answer that gives me the benefit of your years of experience for free. I might read it later. Meantime, I hacked something fragile together that future maintainers will hate me for.
 
<3
 
I almost left that as a comment.
 
Oh index Tuning you're soo much fun.
 
3:43 PM
0
A: Convert yymmdd to datetime using ssis derived column

apariyarI have done something like this and it works. ([Drv DOB] == "0") || ([Drv DOB] == "101") ? NULL(DT_DBTIMESTAMP) : (DT_DBTIMESTAMP)(SUBSTRING([Drv DOB],1,2) + "-" + SUBSTRING([Drv DOB],3,2) + "-" + SUBSTRING([Drv DOB],5,2))

Sigh.
 
0
Q: How to back out of mass update in SQL Replication

nickthompsonWe have a database which is set up in Merge Replication. We accidentally updated hundreds of thousands of records in a large published table on the publisher database. We did is something like this:- update LargeTable set Field=Field So basically, every record got updated to be the same - no...

Ruh Roh Raggy!
 
0
Q: How to back out of mass update in SQL Replication

nickthompsonWe have a database which is set up in Merge Replication. We accidentally updated hundreds of thousands of records in a large published table on the publisher database. We did is something like this:- update LargeTable set Field=Field So basically, every record got updated to be the same - no ...

^ Copied here ^
 
@PaulWhite Someone on SO told him to do it. It's not his fault.
 
@Zane I saw.
 
@bluefeet do you want to delete the one on SO? That is if we want this question.
 
3:54 PM
Sounds like someone needs to update their resume.
Well maybe not. As I read it, it's not quite what I thought it was. I'd just
probably say suck it up and let it run, but I don't know replication well enough to recommend another solution.
 
@MikeFal the problem is that they have an unfiltered where .... OOOOOOHHHHHHHHHHHHH
no changes were made.
yeah. suck it up
 
Right
 
AFAIK there are no supported solutions other than letting it run or reinit repl from scratch. He won't want to hear that though.
 
Hack the gibson
 
I would also say they dodged a bullet there. It could have been a lot worse.
 
JNK
4:06 PM
@PaulWhite we JUST did this a few weeks ago
and I had to reinit the repl
The DBA™ somehow did not know that subscribers run updates RBAR
 
Well, to be fair, I didn't know that either. But I really haven't used replication.
@JNK Did you every submit your stuff to Xero?
 
JNK
@MikeFal yeah I sent it to Simon
@MikeFal something he claims to be an expert in
he eventually hypothesized we should have batched the update
@MikeFal but someone in here knew about it without having to look, I forget who
ypercube maybe
 
4:23 PM
please close as dup
0
Q: How to back out of mass update in SQL Replication

nickthompsonWe have a database which is set up in Merge Replication. We accidentally updated hundreds of thousands of records in a large published table on the publisher database. We did is something like this:- update LargeTable set Field=Field So basically, every record got updated to be the same - no...

 
@bluefeet Fox 3 away
 
Sorry I'm late, @bluefeet! Kinda got hung up back there!
 
@swasheck har har har :)
 
Just the binding one to go.
 
@bluefeet so you got the joke?
 
4:27 PM
@swasheck Si
 
Tak!
 
@swasheck By the way, did you know it's same in Ukrainian? We use Cyrillic letters of course, but it's pronounced the same.
 
@AndriyM i didnt, but now i know
 
the heap hath spoken
 
4:32 PM
I might even venture a BOOM! at this point.
BOOM!
 
... goes the dynamite
 
Alright time to tune this but ugly query.
 
finally....The Heap didn't want to load for me the whole morning
 
It's becoming self-aware
 
4:47 PM
yeah, somehow it didn't want me to see what you guys were talking....suspicious
 
how to average counted data?
for example i have column
_________________
 
SELECT avg(MyCol) FROM MyTable
 
______
| a | b |
______
| 0 | 0|
| 1| 0|
| 2| 2|
_______

avg(b) result = 2/3
 
SELECT AVG(b) FROM MyTable except it'll report back .6666 repeating
 
oh i forget
how to ignore 0
?
 
4:57 PM
Well this column has no statistics. That's no bueno.
 
so i want avg(b) = 2/1 = 2
 
where b <> 0
:17271372 That works too.
 
@Zane _WA3207438098&)*(*&$#)*$F&$)&*($^%R to the rescue
 
errr ^
 
00:00 - 17:0017:00 - 00:00

« first day (1325 days earlier)      last day (3547 days later) »