« first day (2269 days earlier)      last day (2605 days later) » 

1:59 AM
sometimes I think I'm the only one who uses sys.dm_exec_query_profiles. feels so lonely
 
 
4 hours later…
6:15 AM
@JoeObbish Not directly related to your stats answer, but you might find this interesting, if you haven't seen it already:
 
 
2 hours later…
8:02 AM
'
 
4
 
@AndriyM you won
 
8:18 AM
@dezso I like yours better though.
Good apostrophe everyone
 
@hot2use @PaulWhite plagiarists!
 
@PaulWhite Cursors are forever
 
8:37 AM
Cursors run forever?
2
To be fair though, pre-2012 a SQLCLR "cursor" was a great option for running sums etc.
 
@dezso :-P
 
9:34 AM
Please consider changing the accepted answer. The solution from mik is idiomatic for Oracle, very fast, and by far the most elegant. — Jack Douglas ♦ 55 secs ago
I've never nagged someone to change an accepted answer before, but in this case I think it is justified — sorry @billinkc if it means you lose 15 internet fairy points
 
@AndriyM still cannot tell how you did it
 
@JackDouglas In the other q you commented, please post an answer if you think there's a better way.
 
@ypercubeᵀᴹ I did :)
sorry, should have said that in my comment
 
You seem to be answering a different question - to the one I understood was asked.
 
oops
 
9:49 AM
I understood: if a child (or more) match, no grandchild should be returned.
 
I see what you mean. I think the question is ambiguous though you can read it either way. Your SQL needs tweaking a bit to make it valid because level is a keyword: dbfiddle.uk/…
 
Wouldn't March be a better time for a march?
 
@JackDouglas Does this look like an improvement? dbfiddle.uk/…
Its aim is to stop when at least one B is found
I don't know if that's feasible using CONNECT BY
 
10:03 AM
nice
@ypercubeᵀᴹ dbfiddle.uk/…
tweaked the data so there are 2 results
 
@AndriyM but then the whole month, not only one day
 
@dezso Perhaps it would be even better.
 
@JackDouglas that confuses me!
I have to reread how connect by works.
 
connect by is a lot easier to understand than recursive CTEs which I have to look up every time I use them :p (to be fair you can do more with CTEs I think)
 
is the where bar = 'B' applied after the recursive thing runs?
 
10:14 AM
@ypercubeᵀᴹ yes, that is confusing — would be clearer with a subselect
the connect by is before the filtering
 
I see. So: start with, then connect by to do the recurse, and in the end the where
 
Any procedure I try to create in master results in an error (whoisactive, ola's maintenance)
no idea what's going on
 
@JackDouglas And the various DBMS have different restrictions on CTEs (if referencing the cte in the recursive part is allowed more than once or not, for example)
 
Yes, and most of the restrictions are really painful, preventing you from doing exactly what you want to do on any given occasion!
 
10:26 AM
yep
I had a similar problem at work, that needed a CTE that referenced the whole subset of the previous iteration.
No matter what I tried, I couldn't make it work (in Postgres), except by using arrays and nesting/unnesting
 
that must have been performant
 
yeah. A real pain even to see the code.
One would think," hey SQL works in sets, that should be easy". But no.
 
@AndyK Do you think you could expand the ITIL abbreviation somewhere in your post? Unless it's a common enough term in project management, in which case please ignore my request.
 
Hi @AndriyM, let me do that
done @AndriyM
 
10:48 AM
@AndyK I wasn't familiar with that term at all, by the way. It was easy to look up, I just thought it would be convenient for whoever is learning about project management to have the link handy. Thank you.
 
welcome. It is always good to have a feedback
 
@JackDouglas just found that Oracle has an option for breadth/depth search in recursive CTEs!
 
@ypercubeᵀᴹ there are still lots of restrictions though
 
11:28 AM
@TomV Which error?
 
Msg 208, Level 16, State 1, Procedure Trigger_Procedure_Events, Line 11
Invalid object name 'EADDLLog.dbo.DDLUpdateLog'.
Msg 208, Level 16, State 6, Procedure sp_WhoIsActive, Line 21
Invalid object name 'dbo.sp_WhoIsActive'.
 
@TomV There's a database DDL trigger in master?
 
EA being the prefix of some vendor application connecting to the server, but that is nowhere in the script i'm executing (it's really just whoisactive)
Oh, brilliant, 4 of them
 
Noice.
 
I had seen tables and functions but didn't think of any triggers
whoever installed this product failed
 
11:36 AM
Hard.
 
11:48 AM
Is that cost (64 x $7400) accurate for Enterprise edition with 64 cores?
And is that per year?
 
@ypercubeᵀᴹ where did you get that?
 
2
Q: What big limitations should I expect from Linked SQL Servers?

bungrudiOur product is based on Microsoft SQL Server. Currently, we are using three databases, and have always deployed them on one SQL Server instance. The three database are OLTP, OLAP, and audit. The OLAP database has massive inbound data on EOD from both OLTP and audit, using cross database queries....

a question that Paul answered
 
Pricing info is usually "contact your rep" or "this is what we think you can pay if we have no agreement"
> Pricing represents open no level (NL) estimated retail price. For your specific pricing, contact your Microsoft reseller
I'm not sure how to interpret that table though, if that price is for a 2 core pack, a single core that you have to buy per 2 or whatever
 
@TomV I guess that's how he got the 7K figure (14K / 2)
or 3.7 x 2
 
12:11 PM
@ypercubeᵀᴹ not bad
It does depend on your MLR and/or your terms/agreement
 
Half a million in licensing would probably be more expensive than whatever the OP is selling
So I see his concerns
 
@TomV this is why when speccing a machine for SQL Server you want the fastest cores available at any price, and keep the number of cores to the absolute minimum. And expensive, very fast enterprise-grade PCIe NVMe SSDs are cheap in comparison, and add a ton of ooomph.
 
12:48 PM
@MaxVernon You're doing it wrong, hop on the hypervisor train while you still can
 
MongoDB the third most "loved" database
(for SO users)
Oracle the most dreaded
 
1:11 PM
don't touch what you can't afford
 
How did you know I can't afford it?
 
That moment you connect to an existing RDP session and see somebody modifying production tables using the GUI designer
 
@Lamak you are talking about mongo? ;)
 
(╯°□°)╯︵ ┻━┻
 
@ypercubeᵀᴹ ouch
 
1:14 PM
yes the same server the ddl procs are in the master database
 
@TomV did you hit him?
 
@Lamak I'm still trying to find out who it is
 
good luck with that
 
Does windows event log record RDP sessions?
Looks like it does...cool
 
@Forrest Everybody is using a generic "support" windows account
 
1:18 PM
@TomV Uh, wuh.....?
That makes no....oh, but that fits in with what else you've been complaining about
 
@TomV netstat?
 
@TomV you just need to hit everybody
 
@Lamak I meant the SO masses, not you ;)
 
you know they all deserve it anyways
 
user image
2
finally
 
1:27 PM
it took some trying
 
Now it just needs some catching.
 
@TomV actually every SQL Server I deal with these days is virtualized. I still don't think it's appropriate for "big" servers where you need lots of processing power. Plus you need to license all cores in the box anyway, if you have more than a single SQL Server VM.
So, even when virtualized, it still pays to go with faster, fewer cores.
 
@PaulWhite Did see already but thanks. Now I'm wondering if I should talk about some of the TFs that change how the histograms are interpreted. But they probably won't help so it might just confuse the issue.
 
1:48 PM
@MaxVernon What makes you say that it's not appropriate for big servers?
 
@TomV revoke all access except yours and see who is coming complaining
2
 
2:01 PM
@JoeObbish In my opinion virtualization adds complexity and code overhead that will reduce performance by some measurable percentage. In the case of a large single VM on a single physical machine, the only real benefit of virtualization would be machine mobility; however that can be (easily) mitigated by the various HA technologies offered by Windows and SQL Server. Perhaps there is something I'm not considering.
 
the solution is obviously to pay more money
0
A: OFFSET X ROWS FETCH NEXT 50 ROWS ONLY not using indexes

Steve BuchokWe tested by turning up the DTUs from 10 (lowest) to 100 (highest for S0). Query went from 30 seconds to 6 seconds. So it looks like it could just be a matter of paying more money.

 
Dollar Transfer Units
3
@JoeObbish CE model variation TFs? Probably, yes.
 
2:30 PM
@JackDouglas You fiend! Attempting to rob me of my valuable unicorn points!
 
I've never felt so ashamed
 
Oh surely you have. I've seen your code.
4
 
BURN!
 
that robbed me of more than unicorn points
 
Sorry @Jack I'm joking of course.
 
2:34 PM
@PaulWhite you mean you haven't seen my code?
 
leaves quietly
 
@MaxVernon I think I get what you mean. It's can be unsettling at times to think about how VM is making your queries run just a little bit slower and there isn't much you can do about it.
I did have a case once where virtualization made a query run around 100X slower
That wasn't fun to troubleshoot
It does seem that the industry is moving pretty hard in that direction
 
@JoeObbish that's interesting. Seems a bit curious!
There are so many moving parts around virtualization, especially if there are different teams responsible for hardware, virt, and sql server.
 
@PaulWhite I keep investigating obscure problems and eventually find a blog post written by you about it. I think it's happened three times in a row now. It's very helpful but also a little frustrating in a way...
5
 
2:40 PM
There is no cloud. It's just someone else's virtual machine.
 
@PaulWhite so true.
 
@JoeObbish yeah, it's frustrating that @PaulWhite only blogs about obscure problems
2
 
@JoeObbish Luckily there is a never-ending stream of weirdnesses for people to write about.
 
he should take a hint from some authority in SQL Server
3
 
yikes
 
2:42 PM
@JoeObbish I am so immensely indebted to the knowledge I've gained from @PaulWhite's posts. Its humbling to see that level of knowledge. (Thanks, Paul!)
 
Thanks, Paul!!
 
I'm grateful as well but I want to write about something new!
 
The trick is to start writing about something you know really well - then you get to the demo that doesn't quite work as expected...
 
1 message moved to Trash
 
@JoeObbish are you saying @PaulWhite only blogs about old things?
2
 
2:44 PM
@PaulWhite amen to that. I keep thinking I know something fairly well, then I attempt to MCVE that sucker, and BOOM!
 
Gosh there are a lot of fixes in 2016 SP1 CU2.
 
@Lamak Well, he indirectly blogged about a problem with sys.dm_exec_query_profiles 3 years before it showed up
so he actually blogs about future things sometimes
 
Far out.
 
I can't believe that I forgot that SQL Server 2014 was released on April 1... what a release date
 
@PaulWhite trying to change focus?
 
2:47 PM
There is no way you detected that. I am subtle.
 
All of those fixes make me glad that we didn't go with parallel inserts for CCIs in a bit of code
 
I wonder how long testers last at Microsoft before their heads explode.
 
I've heard people on the internet say that MS fired all of their QA staff
3
 
Ah well then it must be true :)
 
2:50 PM
@PaulWhite you really are subtle
 
And persistent
 
I did deliberately word it that way for a reason you know...
 
Ah.
 
@PaulWhite persistant
 
Ha!
 
2:54 PM
@JoeObbish you baited @PaulWhite?, that's a bannable offense
 
Actually I tried to prevent comments like that. I may have been too subtle though
 
It's catching.
 
I will accept my ban willingly. Too much work to do today
I also heard that there's a much better version of the heap out there somewhere
 
Nonsense!
 
@JoeObbish ah, yeah, good luck with that ;)
 
2:56 PM
I heard it's a bit slack.
4
 
@JoeObbish with fixed reputation system or something?
 
@PaulWhite chuckle
 
hmm, apparently we have a query that performs 100X better on standard edition compared to enterprise edition
maybe Paul White already blogged about this
googling "paul white standard edition" gives me a bunch of search results for guitars...
 
@JoeObbish Was it rewritten for Standard by ten 10xers?
 
groan...
 
3:02 PM
Wouldn't it be nice to be able to run Dev Edition in Standard mode.
 
For testing purposes?
 
Yes.
 
Yeah I don't get that one either. It seems to contradict MS's message of making things really easy for developers. I suppose that they would say that developers don't need to worry about the differences between standard and enterprise...
 
Anyway. Must dash. I have this piece about standard guitars to finish.
 
have a good... morning?
 
3:23 PM
@JoeObbish It's ' these days. Fits all times of day.
 
@AndriyM Looks like all of the good stuff happens when I'm asleep
 
 
2 hours later…
5:38 PM
hello
 
5:53 PM
hello
I didn't know that MSDN could be so direct: "This topic is about the "Remote Access" feature. This is an obscure SQL Server to SQL Server communication feature that is deprecated, and you probably shouldn't be using it."
 
Anyone know off the top of their head, after changing the instant file initialization, is it a restart of the SQL Service for it to take affect or is it a relogin/restart event?
 
restart the service
 
ta
 
there is no safe place
 
6:05 PM
@billinkc - This code will tell you if the SQL Server service account has the Perform Volume Maintenance Tasks privilege:
 
DECLARE @PerformeVolumeMaintenanceTasks VARCHAR(255);
SET @PerformeVolumeMaintenanceTasks = 'UNKNOWN';
DECLARE @LockPagesInMemory VARCHAR(255);
SET @LockPagesInMemory = 'UNKNOWN';

DECLARE @Res TABLE
(
	[output] NVARCHAR(255) NULL
);

IF (SELECT value_in_use
	FROM sys.configurations c
	WHERE c.name = 'xp_cmdshell'
	) = 1
BEGIN
	INSERT INTO @Res
	EXEC xp_cmdshell 'WHOAMI /PRIV';

	IF EXISTS (SELECT 1
		FROM @Res
		WHERE [output] LIKE 'SeLockMemoryPrivilege%'
		)
		SET @LockPagesInMemory = 'ENABLED';
of course, you'll need xp_cmdshell enabled to run it :-)
> Help me with my assignment plz I have erromessage
that should really be:
> Help me with my assignment plz I haz erromessage
 
@MaxVernon Bet you can't wait to retire that one. 2016 SP1 has it in a dmv in case you weren't aware
 
@JoeObbish yah, that's for sure! There are a bunch of things that I'd like to use in prod in SQL Server 2014, never mind 2016 :-)
 
0
Q: incorrect results when querying view

Darlene Turnereveryone. I've got a confusing issue with a query against an indexed view. select top 10 * from view where type_id = 3 produces the top 10 entries in the view regardless of type_id value, while searching any other type_id value produces the correct results. Putting quotes around the 3 or removi...

May it be due he uses WITH SCHEMABINDING?
 
6:15 PM
... is that a picture of his monitor?
 
looks like it, lol
 
bwahahhah
WIN
 
^^^ that video will have me twitchy for some time
@MaxVernon EXEC sys.xp_readerrorlog 0, 1, N'Database Instant File Initialization';
 
beauty
 
According to Glenn Berry's wonder script, that also does the same
 
6:32 PM
@billinkc why!?!
 
Not sure if serious...
 
@billinkc yah, my first advice was going to be check the error log for that, but I couldn't immediately verify it.
 
6:43 PM
London posse take care
@PaulWhite there should be a trace flag for that yes
@ypercubeᵀᴹ on the day we were remembering the Brussels stuff
 
 
2 hours later…
8:34 PM
I so much prefer the model of blocking on Facebook. Damn, I wish I could block people and stop them from seeing me.
That would eliminate so much drama.
The single greatest contribution of Facebook was implementing that.
 
8:47 PM
Still can stalker using another account ;)
0
A: mySQL query don't return me the expected results

McNetsWell, let me try to explain what's happening. First question: Why returns only one row instead of three Have a look at a simplified main query, filtered by BIL_HotelId and IVC_Id: SELECT BIL_Id, IVC_Id, DATE_FORMAT(BIL_Date, "%Y-%m-%d") BIL_Date, BIL_Rate, BIL_Type, BIL_Quantity, IVC_Elemen...

Is my answer correct?
Or at least understandable?
 
9:05 PM
No idea if it is correct but it is helpful.
You may want to change the TOP (n) to LIMIT n
 
@ypercubeᵀᴹ ok
 
And that BIL_Id IN (31,32,33) can be replaced with find_in_set(bil_id, ivc_elements), assuming he wants to check if the element is in that comma delimited string
 
find_in_set produce some weird result, let me try again.
@ypercubeᵀᴹ Can it be used on WHERE clause?
 
of course
find_in_set(a,b) and find_in_set(a,b) > 0 are equivalent in where
 
OK
yes, I must rewrite the whole answer...
 
d'oh. Stupid gold badge. I didn't realize it would re-open unilaterally by me. It seems to me the edit means the question no longer is similar enough to the original "duplicate". Perhaps I'm wrong?
 
@MaxVernon No worries. Lets others decide. We have casted our votes - and hammers - anyway!
 
I'll re-close it
we now return to regularly scheduled programming.
 
10:04 PM
@ypercubeᵀᴹ what is the effect of find_in_set() used in a ON clause?
 
@McNets the same as any condition
find_in_set returns an integer. If the element is in the set, it's the position (so >1). If it isn't in there, it's 0.
 
And null values?
 
Since FALSE=0 and anything is treated as TRUE in condition in MySQL, you can use either find_in_set(a,b) or find_in_set(a,b)> 0
I don't think it can return NULL.
Are you asking what happens if the element or the string is NULL?
 
I mean, one of (a,b) is null
Curiously this JOIN
LEFT JOIN ___SalesTaxes
ON FIND_IN_SET(BIL_ApplicableTaxes, STX_Id) > 0
 
It seems that it returns NULL if either a or b is null.
 
10:11 PM
works fine, until I try to use some field of ___SalesTaxes
 
@McNets shouldn't it be FIND_IN_SET(STX_Id, BIL_ApplicableTaxes) ?
 
Problably I've changed the order.
 
FIND_IN_SET(element, 'comma_deleimited_string')
 
Uncomment GROUP_CONCAT
 
BIL_ApplicableTaxes has no values, is empty.
That's why the last join, to SalesTaxes gets all nulls
 
10:25 PM
But without using GROUP_CONCAT it works fine and returns the 3 rows
 
the rows are there. But when you left join to SalesTaxes, no row from SalesTax is joined.
 
ok thanks @ypercubeᵀᴹ
 
Check the results in this column: BIL_ApplicableTaxes
 
Hello to all! :D
 
Hi
 
10:35 PM
@McNets Hi! How are you?
 
Fine, thanks.
 

« first day (2269 days earlier)      last day (2605 days later) »