« first day (2575 days earlier)      last day (2284 days later) » 

6:42 AM
Hi everybody :-)
Any mods arounds?
User hacksoar could possibly become a royal PITA looking at this question:
1
Q: questionbcvsdgggggggggggggggggggggfx

hacksoarquestiongsdfvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvvv

I've flagged and added a comment
Rolled back question. Nonetheless, might be a good idea to give him a nudge.
 
 
1 hour later…
7:59 AM
@sp_BlitzErik Hadn't heard of it before today!
It would be great if, instead of (as well as) translating a scalar UDF to a relational expression, the engine could give the code to implement it as an in-line table-valued function.
@hot2use Thanks (to everyone who flagged)
 
Norming
Upps morning
 
8:49 AM
Morning
 
gbn
Morning all
 
9:04 AM
evening and morning
 
Morning
 
9:47 AM
morning
 
9:59 AM
Is there a way to get OBJECT_ID() function text?
exec sp_helptext @objname = 'OBJECT_ID';
doesn't works
 
@hot2use Thanks
There isn't the code
 
10:27 AM
Hmmm.
@McNets SELECT * FROM syscomments WHERE TEXT LIKE 'CREATE FUNCTION %VAR%'
Might work in some cases.
 
@hot2use which db should I use, master?
 
There is a lot in master. Depends where the function is.
Found this gem:
create function sys.fn_numberOf1InVarBinary (@bm varbinary(128))
returns int
as
begin
    declare @len int
    declare @count int
    declare @subbyte binary
    set @count=0
    set @len=DATALENGTH (@bm)
    while (@len>0)
    begin
            set @subbyte=SUBSTRING(@bm, @len, 1)
            set @count=@count+sys.fn_numberOf1InBinaryAfterLoc(@subbyte, 8)
            set @len=@len-1
    end
    return @count

end
 
I wonder if there is some built-in UNQUOTENAME function
 
gbn
@McNets REPLACE(@SomeString, '[', '')?
 
Something like:

CREATE FUNCTION UNQUOTENAME(@TXT NVARCHAR(MAX))
RETURNS NVARCHAR(MAX)
AS
BEGIN
RETURN IIF(LEFT(@TXT, 1) = N'[' AND RIGHT(@TXT, 1) = ']', SUBSTRING(@TXT, 2, LEN(@TXT) - 2), @TXT);
END;
if fact OBJECT_ID allows to use both quoted and un-quoted names as a parameter
 
gbn
10:38 AM
@McNets This is not consistent with all system function. I dunno which but I've been bitten before
 
ok
 
TRANSLATE() as of SQL 2017
 
11:04 AM
I don't think you can apply sp_helptext/OBJECT_DEFINITION to built-in T-SQL functions like OBJECT_ID or otherwise get their source code in T-SQL.
As for accepting unquoted string parameters just as well as quoted, I think that's just a peculiarity of the syntax, and it works with built-in functions but probably not with those created using CREATE FUNCTION.
It works with stored procedures too, by the way.
USE tempdb
GO
CREATE PROCEDURE dbo.TestProc (@StringParam varchar(100))
AS
SELECT @StringParam;
GO
EXECUTE dbo.TestProc test;
GO
DROP PROCEDURE dbo.TestProc;
GO
 
10
Q: What allows SQL Server to trade an object name for a string passed to a system procedure

JJSWhat causes it to be legal to pass an object name to the system stored procedure sp_helptext? What mechanism converts the object name to a string? e.g. -- works sp_helptext myproc sp_helptext [myproc] sp_helptext [dbo.myproc] -- and behaves the same as a string sp_helptext 'myproc' sp_helptext...

You may find that relevant/helpful @McNets
 
11:19 AM
@PaulWhite slippery answer!
Or should I say... Slippery as?
 
Ah now that I understand. Ok well I wasn't trying to be slippery, so "no".
Anyway, Clippy should pop up and say "it looks like you're trying to ruin the performance of your query. Try this equivalent in-line function instead."
2
Is there any reason to think Froid != Freud?
 
That was exactly how I read it
I hope that it's an indication of how much cocaine was involved in the design and creation of this feature
Maybe those backwards scans will see parallelism someday...
 
11:35 AM
@sp_BlitzErik Which backward scans?
Anyway, it's nice to see scalar UDFs getting some Froidian Analysis
 
@PaulWhite the ones that aren't parallel, yo
 
@sp_BlitzErik There aren't any of those in the froid paper though?
The arxiv version with a picture of an execution plan
 
@PaulWhite No, that would be a bit out of scope to the udf issue
 
Oh right so the statement was unconnected. I see now.
 
Suppose I need to get ready to update a good chunk of training material
 
11:38 AM
I have a theory that no one wants to touch that code with a ten foot pole
(to fix backward scans)
 
Yeah, seems that way in my interactions as well
 
@sp_BlitzErik Depends how well it works in practice I guess.
It's a great idea, if only because so few people have the skills to convert a scalar UDF correctly.
 
Which is shame considering how (relatively) often parallelism is neglected because of the additional distribute streams operator
 
It'll all be moot once everything is natively-compiled batch mode in memory (columnstore optional)
 
@PaulWhite some are terribly complex, but sure. Came across one that was just returning a random number from 1 to 7 though.
 
11:42 AM
</s>
@sp_BlitzErik Oh for sure the vast majority of scalar UDFs are just dumb because the writer didn't know better, and/or just (reasonably) expected performance to be at least OK.
 
You can use moderator powers to make that look better timed if you'd like 😁
 
Why help the lazy transcript readers
Should be some amazing results for scalar UDFs that currently trivially access a table
i.e. which any sensible person would immediately rewrite as an apply
dbo.fn_get_x_by_y__slow
Of course someone will complain that Froid results in too many nested loops joins
Or that pass-through predicates result in poor cardinality estimates
Hence my suggestion to add this as a suggested rewrite with code, which could then be hand-optimized as necessary.
 
So your clippy would really just be telling people to hire a professional?
 
Bait-n-switch with some code provided first, but yeah :)
@sp_BlitzErik But to make it clear: instead of rewriting the UDF in place, the engine could provide a replacement in-line function written in T-SQL.
Maybe they'll extend it that way. Seems pretty natural to me.
In DTA and elsewhere
 
I wonder what other rewrites will be offered
Dta though...
 
11:52 AM
DROP DATABASE xyz;
 
Sounds like ad ware to me
 
@sp_BlitzErik Gets a bad rap. It's a pretty useful tool if you know how to use it and interpret/apply the results. It's really just missing index suggestions on roids, and people cope with them.
 
"looks like your database has x problem, Microsoft Certified partners are standing by"
 
Eeek.
Hey isn't it amazing how many of these things are finally getting some attention now they can see some of the real problems for themselves at scale on Azure.
 
Yeah, I'm loving the robots
 
11:56 AM
I feel like slapping Conor around the head with every scalar UDF AdventureWorks demo and Won't Fix Connect item submitted over the past couple of decades.
 
A lot of problems could be solved by running dta once or never running dta again.
 
No doubt that's true. #FirstWorldConsultancyProblems though.
 
@PaulWhite or the query team posts he wrote about putting them in computed columns to improve cardinality estimates?
 
In principle I like the idea of the engine automatically applying indexing tweaks etc then monitoring them for effectiveness.
Some of this self-tuning feedback stuff can work well for the right workloads.
(I don't really blame Conor, but he is a convenient scapegoat)
 
For sure, but the missing index rules engine is a turd
 
12:01 PM
Missing index suggestions/DMV entries in general, or DTA specifically?
 
Ok but I'd maintain they're a lot better as a starting point than nothing.
Assuming the user has some experience.
But I'm speaking mostly from a theoretical perspective/personal experience on toy queries.
I'm quite willing to accept it causes more problems than it solves in the wild.
But I have very little experience of that.
 
anything can work on the simplest queries
look at all my code
 
There's a lot to be said for writing simple queries.
 
@PaulWhite thank you
 
12:07 PM
I often find people run out of talent on more than about 20 lines of SQL (per query).
 
oh i just meant that a lot of the checks i had in blitzcache worked fine for a single statement but would fail direly in a stored proc or in a stored proc with more than a single statement
 
Would be brilliant on Postgres then
@sp_BlitzErik Can you give an example?
I should probably download the blitz tools someday
Most of my test instances don't even have who is active these days
 
there have been plenty where i didn't have an existence check for a particular branch of xml or where i wasn't filtering or ordering the results so that if the offending bits were magically first they wouldn't get flagged
sp_whoisactive would be useless for you
only you are active
 
Oh right. So xml made it hard. Surprising.
 
the xml was easy, i was just writing naive repros
 
12:15 PM
I was being kind ;)
 
very sad, i know
mourn for me
 
Writing demos and repros is hard!
But OK 😢
 
writing believable demos is hard
 
That's a genuine tear
@sp_BlitzErik Use more UDFs
 
they'll be irrelevant in a year
or in 2017r2
 
12:18 PM
Ha!
 
12:38 PM
@SeanGallardy-Microsoft what kind of board games?
 
1:26 PM
@ypercubeᵀᴹ All kinds! My current favorites would probably be Betrayal at House on the hill, forbidden Desert, or Pandemic
 
@SeanGallardy-Microsoft multiplayer I suppose.
 
Yes, all of them.
 
No abstract ones? (like Hex, Go, Othello ...)
 
I don't find those fun, you can only beat one other person instead of beating 4 other people all at once!
 
haha. That's a point, yes.
I find them the opposite way, to be honest. I got to some meeting with this kind of games and I was rather bored.
 
1:30 PM
@ypercubeᵀᴹ Go is abstract?
 
The start wouldn't be but the rest of the game would afaik
 
Some were fun but not good enough for my taste, to repeat the experiment
@Lamak yes, why?
 
It's the scheming and plotted and backstabbing
 
@SeanGallardy-Microsoft I had tried Diplomacy,many years ago.
through an email server!
lots of back stabbing
 
It's like when I used to play Eve... One of my characters was named "Theivy McBackstabber" and I stole from corporations... they always asked me why. It's literally in my name.
I don't know Diplomacy
 
1:33 PM
Diplomacy is a strategic board game created by Allan B. Calhamer in 1954 and released commercially in 1959. Its main distinctions from most board wargames are its negotiation phases (players spend much of their time forming and betraying alliances with other players and forming beneficial strategies) and the absence of dice and other game elements that produce random effects. Set in Europe before the beginning of World War I, Diplomacy is played by two to seven players, each controlling the armed forces of a major European power (or, with fewer players, multiple powers). Each player aims to move...
 
@ypercubeᵀᴹ I didn't know that they were called as such...
 
wow
That's rough over email, though it does have advantages if you can't mask your voice or your tells
 
A strategy game or strategic game is a game (e.g. video or board game) in which the players' uncoerced, and often autonomous decision-making skills have a high significance in determining the outcome. Almost all strategy games require internal decision tree style thinking, and typically very high situational awareness. The term "strategy" comes ultimately from Greek, (στρατηγια or strategia) meaning generalship. It differs from "tactics" in that it refers to the general scheme of things, whereas "tactics" refers to organization and execution. == History == The history of turn-based strategy games...
 
@SeanGallardy-Microsoft your current username says "minus Microsoft", I wonder what that means
 
@SeanGallardy-Microsoft I only tried to play it face to face once, with my friends.
 
1:37 PM
@ypercubeᵀᴹ I would've liked to be good at chess
 
@Lamak Depends how you look at it ;)
 
We didn't manage to finish the game, maybe did 2-3 rounds.
Quite complicated rules regarding the movements of pieces, after the negotiation phase.
 
I don't mind chess, I just don't have the patience for it.
 
@SeanGallardy-Microsoft what about speed chess?
 
I guess that's one reason why it (diplomacy) got popular through a server. The resolution was done by program/server.
 
1:40 PM
@Lamak Sure, but most people get all upset about it. I'm not good at it, I'd say I'm slightly below average.
 
@SeanGallardy-Microsoft and chess boxing?
 
Never tried it, but I'm small and swift with an average reach.
 
@Lamak Until you play against Vladimir Klitschko or his brother
 
@TomV ah, yeah...no thanks
 
@Lamak oh, never seen that before
 
1:55 PM
@ypercubeᵀᴹ quite inventive
 
@Lamak like mixing beer with whiskey.
 
@ypercubeᵀᴹ Everybody knows that's what you're supposed to do
 
@SeanGallardy-Microsoft oh, didn't know it was invented in the US. I thought it was a German thing
 
In fact, you drop the whiskey in the beer and drink as fast as possible, doing as many of these in a row as possible...
Everyone knows that's a splendid idea of a way to start the night.... if you don't want to remember anything for 2 days.
4
 
@SeanGallardy-Microsoft We did that with apple gin, you drop the glass in the beer like you say
we called them "submarines"
2
 
2:07 PM
@ypercubeᵀᴹ so you are saying the @sp_BlitzErik would like it
 
@TomV Was it Yellow?
 
I only tried it once, but it was quite popular
 
gbn
Or "depth charge" or "jaeger bombs" etc
something for the young people these days
 
We did submarines (U-Boot) with Swiss Kirsch (40% distilled cherries) and beer.
 
 
2 hours later…
4:01 PM
0
Q: SQL Server JOIN not working

Juan VelezI am not sure why the below join query is not returning any results. SELECT * FROM table1 JOIN table2 ON table1.fieldid = table2.idfield The below 2 queries return results so I am not sure why the join wont pick up any rows when i can clearly see that both tables have join field values in co...

 
4:12 PM
@ypercubeᵀᴹ how should I use OBJECT_ID() in this case? dbfiddle.uk/…
 
this seems to work
 
@ypercubeᵀᴹ yes
@ypercubeᵀᴹ But in fact it removes outer brackets.
 
@Lamak drinking beer! next thing i know you'll be accusing me of bowling and eating bologna.
 
cya
 
am i crazy or is this a dupe of a million questions on here?
0
Q: Selecting records that contain letters and/or non-alpha characters

Anonymous ZI have table with a string field ID with values looking like this: 012345678 I want to select all the records from the ID field that begin with a 0 and have a letter in them, e.g 000A345B or 0A32C450. I also want to select records that begin with zero and contain a -, / or a space. Note th...

 
4:17 PM
@McNets yes, indeed. It seems to do that.
 
@sp_BlitzErik don't all of you guys bowl?
 
@Lamak this is the kind of insidious racism that should not exist in the age of obama
 
gbn
@sp_BlitzErik Orange is the new Black I hear over there
3
 
@sp_BlitzErik anyway, I might have to treat you better in the future....
@gbn nice
 
@gbn crafty
 
@McNets it does indeed seem to be unquoting the string! dbfiddle.uk/…
 
@ypercubeᵀᴹ funny table name ;)
 
@AndriyM you could edit that answer more to add COLLATE Latin1_General_Bin on those searches -- sometimes speeds'em up pretty well
 
4:53 PM
@sp_BlitzErik The thought crossed my mind, but then I couldn't remember if it should be _Bin or _Bin2 or whether it's a good idea to use Latin1_* if their environment actually uses SQL_Latin1_* etc.
I suck at collations
 
5:18 PM
@PaulWhite yoooo, my frienndddd
What do you think about a mysql-aio tag? there are at least a bazillion questions involving the innodb thread pool
I think what we need to consider doing is burning performance and optimization related tags, and the horrible postgresql-performance and pushing smaller more reasonable tags about what is actually be optimized or whatever.
 
@EvanCarroll -aio? You serious?
 
5:45 PM
Don't care exactly what you call it, mysql-threads?
There are 653 questions on this site, most of them are all the same thing threads waiting, locked, or suspicious.
There are 40+ questions just with "aio reads" "aio writes"
 
@EvanCarroll I haven't seen them. Or probably saw them and ignore them.
 
For sanity, you++
 
Anyway, I don't know what value is added if we add this specific tag.
 
thing about them is you can't really do anything other than read the docs to people and tell them to pray for the best
 
I don't really mind, anyway
 
5:52 PM
Yeah, ok I'll drop it as I don't care about MySQL anyway. I just have a tendency to want to organize things when they become an epic mess and a lot of these questions are use-case independent but could all be answered with the same answer.
 
we should just purge mysql questions anyway, right?
3
:D
 
We should purge MySQL.
 
@AndriyM i'm not very good either, just have that one burned in from doing awful string things
 
PostgreSQL's string collations is supremely weird.
they use a binary cmp as a tie breaker, so two things that are collate-equal are still not equal
I think that's a bit too much implementation being exposed to the user for my tastes
 
 
4 hours later…
10:22 PM
I see @EvanCarroll killed the room's vibe with his Collation talk...
 
I am "the room"
 
your parties must be epic.... ally quiet.
 
My parties are EPIC.
 
@TomV same word for them in my country.. especially with rum and beer
not very friendly with the brain for the following day(s) :)
 
11:01 PM
@SeanGallardy-Microsoft it's like everyone at the damn gym made a resolution to waste my damn time
 
@sp_BlitzErik HAHAHA it was packed at the apartment gym too :( EVERYONE AS DOING CROSSFIT! ARGGGHHHHHHHH
 
yeah i had a couple people standing on upsidedown balance half ball things doing goblet squats... without a goblet
-_____________________________________________________________________________________________________________________________________-
 
lol
idd you look glaringly at them?
 
i just don't even know how to respond anymore
how do you show up to a gym in january doing that shit
you're like a living meme
 
@sp_BlitzErik At least it gives the kids something to put on facebook?
 
11:06 PM
it is all sadness
really crashes my e2 iykwim
 
:D
makes me wanna come home with a pint of ben and jerrys and watch tin cup
 
LMFAOOOOO
I saw this tiny chick benching what looked like 2 plates on each side... I was like no effing way... turns out I was right
You know in the crossfit stuff they make their plates like 15 pounds?
I bet the bar wasn't even 45
 
@SeanGallardy-Microsoft don't talk bad about crossfit!
 
11:13 PM
they have barbells called "bella" that's like half the weight of a real one
 
bluefeet is watching ;)
 
I know that isn't the first rule of crossfit... because that's all they talk about
 
of course it's rogue so everyone who does crossfit...
 
lol
You're so Rogue, @sp_BlitzErik
 
hahahaha
 
11:15 PM
@ypercubeᵀᴹ honestly I have nothing against it except for everything
I watched a competition for 35 seconds on tv at one of the gyms when I was travelling... I instantly felt sore in all my joints.
0 form. 0.
congrats, you won't be able to walk in 3 years
 
the competitions are brutal
i wonder if anyone who does crossfit competitions actually does crossfit to train for them
 
@SeanGallardy-Microsoft I don't know nothing about it. Or rather I didn't before searching about it, after bluefeet mentioned it in this room.
 
beautiful edit suggestion from the OP.
 
@dezso HAHAHA
 
11:19 PM
My exercise is walking from home to the car ;)
 
@sp_BlitzErik um, no you're wrong. that bar is 35# a mens bar 45#
 
@dezso HAHAHAHAHAHAHAHA
 
@dezso he was doing that yesterday too
 
@dezso oh, he is the one that tried to vandalize his own question?
 
Ok, shhhh @bluefeet is back
 
11:20 PM
looks busy
 
@ypercubeᵀᴹ didn't notice that bit. They might need a different type of help.
 
@SeanGallardy-Microsoft back? I'm always here
 
Always Watching
 
@dezso yeah, hot2use noticed. The question was later locked by Paul
 
11:38 PM
How does anyone do a intro about themselves for 5 minutes? That's an insane amount of time to just say who you are.
 
sounds like someone doesn't really know who they are~
 
I need to write my own intro and they said "Make it about 5 minutes"
"Hi, I'm Sean and I'm a jerkface."
2
That's what I have so far...
 
you should create a database named sean and fill it with tables of things you like and your accomplisments
then select random things from it
be real flowery
 
/sigh
I'm doing a short intro, ef the gov't
 
you could rap your intro
 
11:48 PM
you've met me...
Imagine, in your head how that'd go
 
you just need big enough sunglasses
 
Maybe a large clock around my neck?
 
i mean maybe just a bucket hat
 
that's like perfect
 

« first day (2575 days earlier)      last day (2284 days later) »