« first day (2463 days earlier)      last day (2405 days later) » 

3:23 AM
@JoeObbish Well he needs the publicity
 
3:44 AM
@PaulWhite me too, thanks
 
4:03 AM
Well you'll never get famous with a default avatar
 
 
2 hours later…
5:55 AM
Morning
When creating a linked server, is it possible to specify a link to self in a generic way if it's a named instance?
I know that e.g. '.' would be a valid server reference if my instance was a default one, i.e. just SERVERNAME, but what if it's SERVERNAME\INSTANCENAME?
 
gbn
6:11 AM
@AndriyM do you want to do this programmatically?
 
@gbn I would like it to be a valid generic reference, like the .
If there is a way.
For now I'm specifying it as .\INSTANCENAME, which I'm happy to go with if there's no way to avoid specifying the instance name.
 
gbn
6:29 AM
EXEC sys.sp_addlinkedserver 'SELF', '', 'SQLNCLI', @@SERVERNAME
SELECT * FROM sys.servers
 
> Concurrency is hard; sorry about that
 
gbn
I'd use "SELF" as a valid generic reference for all servers. Linked servers are useful, sometimes, but I do dislike when they contain actual server or instance in the name. It breaks code deploys etc
@sp_BlitzErik Only the con Swiss Franc
Ignore that above. Correct SQL
EXEC sys.sp_addlinkedserver 'SELF', 'SQL Server'
EXEC sp_setnetname 'SELF', @@SERVERNAME
SELECT * FROM sys.servers
and if you want to re-link it

EXEC sp_setnetname 'SELF', 'foobar'
SELECT * FROM sys.servers
then

EXEC sp_setnetname 'SELF', @@SERVERNAME
SELECT * FROM sys.servers
@sp_BlitzErik Brooklyn or Oregon, still bloody early over there
 
@gbn the troubles of a man who finishes a bottle of wine before bed
 
6:44 AM
@sp_BlitzErik I felt the need to apologise somehow
 
@PaulWhite wait until he finds out about RCSI
 
gbn
@sp_BlitzErik the bottle of wine finished you then...
 
7:01 AM
@gbn ⛲
 
7:21 AM
Bon dia !! (Catalan)
 
Morning
 
@gbn Thanks, I've learnt something new.
What I'm a little concerned about is this note in the manual:
> Using sp_setnetname to point a linked server back to the local server is not supported. Servers that are referenced in this manner cannot participate in a distributed transaction.
 
gbn
@AndriyM Never had any problems (admittedly I rarely use them now, not for 10 years)
Do you need distributed transactions?
 
@gbn Not now, I don't think.
 
7:43 AM
morning
congrats @McNets for the referendum
 
@AndyK thank you, but ~ 800 injured is not good news
 
@McNets democracy is a rough game
 
Yeah I'm not sure it was a huge success
 
terrible
 
@AndyK yes
 
7:46 AM
I'm not talking about the outcome, I have no opinion on that because I don't know enough about the situation
But those aren't circumstances we expect in a civilized part of the world
 
@TomV sure
 
@McNets a friend of mine asked on her fb what kind of democracy Europe is promoting before remembering that EU started as an economical zone, not as a democratic one
 
@AndyK money rules
 
@McNets I'm shared between the pessimistic answer of always or a more optimistic one of again
 
I hope this time something will change
 
7:52 AM
@McNets it will. reverting back to autocraty or muting the voice of People are neither a decent options
 
gbn
@AndyK The last 20 years have demonstrated that the EU is quite autocratic. Just look at the national votes on treaties:you said "no"? Vote again until you get it right
It takes the shine off the good things: internal borderless customs, reduced mobile phone tariffs etc. The good things affect people more on a daily basis though, so this is what they think the EU is
 
@AndyK It's really still mostly a monetary union and not a political one
 
@TomV yes
Although Jean Monnet and Konrad Adenauer dreams were grand
 
My personal opinion is that they should have worked towards a more integrated political union before expanding. Things would have been a lot easier I believe
 
@TomV +1
 
gbn
8:08 AM
@TomV Common currency, not a monetary union
There are no regional transfers from "rich area" to "poor area" like within a country (Zurich, London, New York, California etc). No shared national debt. Etc
 
@gbn I wikipedia'd that and it seems that's the correct translation indeed
 
gbn
although, I don't fully know the difference between "monetary" from "fiscal"
 
Though with the tax and debt rules coming out of the EU it seems somewhere in between now
The EU reviews the state's balances and imposes some changes every now and then
 
gbn
@TomV Agree. Countries have a common currency after being a country. The EU started with a currency
@TomV Which are ignored if you are a big country
 
I see it from a Belgian perspective. We don't really get to ignore them
 
gbn
8:14 AM
@TomV Itself a country almost split in 2. Although you managed very well without a government for, what, 400 days. Well played sir
 
@gbn I keep trying to explain that, but the splitting thing doesn't really interest most of the population. It's just a politicians game. There are some rough edges that should be sorted but most of us realize that splitting the country would be more hassle than it would be worth
The Brussels situation would be nearly unsolvable
 
BTW, 8 days w/o smoke
 
gbn
@TomV Are you a Walloon or Flemish?
 
@sp_BlitzErik He's already using it!
 
8:30 AM
@gbn I'm Flemish
But I live so close to the French border almost everybody here is bi-lingual
 
8:53 AM
@McNets nice
 
 
2 hours later…
10:48 AM
@ypercubeᵀᴹ, because of the application logic. — Boban P. 3 mins ago
The title of that q should not be "concurrency issue" but "How to create a concurrency issue"
 
People always try to out-think themselves with these sorts of things
Or think they can make it simpler by making it more complex
Kinda odd
 
@PaulWhite Yeah. DBMS developers had put a lot of effort into making auto incrementing columns working without transactions blocking one another. But people still think ("I'll put a lock and it will be ok")
 
 
1 hour later…
12:13 PM
@PaulWhite i struggle to see how all his questions aren't duplicates of each other
 
@sp_BlitzErik To some extent yes, but the alternative is the dreaded chameleon question. If it becomes disruptive we will deal with it.
 
eaml chameleon question
 
435
Q: Exit strategies for "chameleon questions"

AarobotI'm not sure if there's already an existing term for this, so I'm inventing my own. (tl;dr: I call them "chameleon questions" because they change every time you submit or edit an answer. If you're already intimately familiar with the phenomenon, please skip past the first set of bullet points t...

I'm not certain that's exactly the right term for the situation, but I guess I'm saying I'd rather have n similar questions than one great big question that morphs over time with a mess of answers from different points in time, and endless comment/chat.
 
reading the description reminded me of something else
 
12:29 PM
hm
Well the (deserved) downvotes on the most recent question mean he won't be asking any new ones for a while. That might produce a rethink.
 
perhaps
how many times am i going to forget to ask for an actual plan before running this query that takes 6 minutes?
 
@sp_BlitzErik You gave a very good answer anyway.
Of course that will only encourage him/her.
@sp_BlitzErik Doesn't the new hotness allow one to grab a plan during execution? Or you specifically need the end-result plan?
But to answer directly: several more times than you would expect.
 
@PaulWhite they're very much estimated plans still
 
@sp_BlitzErik Are they? I've not played with it.
and more specifically sys.dm_exec_query_statistics_xml
 
yeah, we use that in blitzwho now when available
 
12:39 PM
I would have tried it but I just don't trust trace flags
 
it seems to give you a snapshot of the plan as its in progress
so some operators may show final actuals, others may still be working on it
 
It seems (from the docs) that the entry just disappears when the query finishes.
 
very much so
 
Which is rather unhelpful in the case where one has simply forgotten to request a post-execution plan.
 
i have a client call starting in 15 minutes, but i really just wanna sit here listening to the chameleons and trying to break adaptive joins
life is v. unfair
 
12:46 PM
Yes, yes it is. Then you die.
Well you got a bunch of "error has been repaired" messages, right? Run CHECKDB again. Does it still show errors? Run the repair again. Does it still show errors? Etc. etc. If you still have consistency errors, time to create a new database, migrate as much data as you can, and cut your losses. — Aaron Bertrand ♦ Feb 18 at 16:32
From February
 
i've always said we need a version of checkdb for people
2
 
Ha. Have a star.
 
hooray for me
isn't it that remote queries run under serializable?
 
1:02 PM
What's the implication of "live" in "live server/instance/DB"? That it's basically accessible online but not necessarily being accessed right now (by others)? Or that it's actually production or otherwise getting (perhaps many) connections? Or that connections are not strictly read-only?
 
@AndriyM I read it as "production"
 
@ypercubeᵀᴹ Thanks, I think that would be my first guess too.
 
@sp_BlitzErik I think you're thinking of the reverse process i.e. remote insert/update/delete.
 
Basically, "going live" for me is synonymous with deployment, I just wasn't sure whether I had that right or whether it's always the same meaning.
 
gbn
1:18 PM
Usually if the system is already live
I can deploy to a system then "make it live" later (eg blue/green web deploys or update DNS aliases or deploy a client update or change web.config etc)
 
@sp_BlitzErik Ooo it might escalate to serializable for a distributed transaction. Ages since I thought about this stuff.
 
gbn
also... I can deploy many times to a live system, but it can be only "live" once. Or deploy to QA
@sp_BlitzErik I've met people who would fail the Turing test...
4
The Turing test, developed by Alan Turing in 1950, is a test of a machine's ability to exhibit intelligent behavior equivalent to, or indistinguishable from, that of a human. Turing proposed that a human evaluator would judge natural language conversations between a human and a machine designed to generate human-like responses. The evaluator would be aware that one of the two partners in conversation is a machine, and all participants would be separated from one another. The conversation would be limited to a text-only channel such as a computer keyboard and screen so the result would not depend...
 
@PaulWhite seems to me a DTC transaction against a remote SQL Server uses Read Committed. At least in a quick test.
DECLARE @cmd nvarchar(max);
BEGIN DISTRIBUTED TRANSACTION t
SET @cmd = 'SELECT [Server Name] = @@SERVERNAME
    , [Isolation Level] = CASE transaction_isolation_level
        WHEN 0 THEN N''Unspecified''
        WHEN 1 THEN N''Read Uncomitted''
        WHEN 2 THEN N''Read Committed''
        WHEN 3 THEN N''Repeatable''
        WHEN 4 THEN N''Serializable''
        WHEN 5 THEN N''Snapshot''
        END
FROM sys.dm_exec_sessions des
WHERE des.session_id = @@SPID;

USE tempdb;
BEGIN TRANSACTION
IF OBJECT_ID(N''dbo.TestTable'', N''U'') IS NOT NULL
I might be doing something stupid, though.
 
@gbn I should have clarified that I was talking about deployment to production specifically in that case. But your previous example of blue/green deployment in web development seems to show that there may indeed be shades of meaning to "live (server)"
Thanks
 
Am I suggesting something invalid here - just got a downvote and am a little surprised. Not that I care all that much, I just don't want to give wrong advice.
@PaulWhite - what's with your avatar?
 
1:32 PM
@MaxVernon a bet
 
ahh
 
@AndriyM yeah. We had a "live" server once. Then it went "live-live". I guess that would be blue/green in gbn's terminology
 
@MaxVernon Yeah it might be old information, or something that depends on how the DTC is configured.
 
Is the search tool (for chat) broken for everyone or just me?
 
@ypercubeᵀᴹ It probably would. I must say that, although the concept itself makes sense to me, it sounds like something requiring extra care (and, therefore, "fun" to work with)
 
1:38 PM
@ypercubeᵀᴹ for me too
 
@Lamak I'm seeing no results returned
 
@MaxVernon I suppose somebody doesn't like magic numbers
 
@TomV thanks for confirming. That's my suspicion too. The old NULL vs NON-NULL debate rages on with some folks I guess.
 
I don't see another option to make the distinction between "don't know" and "doesn't apply" except "null" and "some magic number" unless you start adding an extra bit field for every column where "doesn't apply" is a possibility
i.e. "mycolumn int null" and "mycolumn_doesnt_apply bit"
I probably would use null for "not supplied" in many cases though
 
@MaxVernon interesting suggestion. (the 3 rows status table)
 
gbn
1:49 PM
@AndriyM I'd say live is "end uses are connected and doing stuff"
 
@ypercubeᵀᴹ thanks.
 
Or your status table instead of a bit, sure
I can't think of another option to achieve the requirements
 
gbn
@MaxVernon allegedly, NULL was to be 4 valued logic to capture "not given" vs "unknown"
 
@gbn Or, in the case you've just made the system live, "can connect at any moment now"
 
@TomV the other option is what the linked book describes. Split the table vertically - essentially into 6NF if all columns require nuls - and then horizontally, having one table for each possible meaning of NULL.
 
gbn
1:51 PM
@AndriyM yes, true
 
In my datawarehouses I used to have an "invalid data" status too, where for some reason the data cleansing process couldn't figure it out (for example when matching CRM data with LOB data and some value didn't match between systems)
 
@ypercubeᵀᴹ I unfortunately did not take the time to read the book. Perhaps I should have.
@ypercubeᵀᴹ I was thinking filtered indexes might be useful too. (filtered on each "status" type)
 
@MaxVernon I skimmed through that chapter (23). I've read the same suggestion (by the same authors) in a different article.
 
@ypercubeᵀᴹ They are working on it.
We are continuing our Elastic Search upgrades today, so performance of Stack Overflow and Stack Exchange will be degraded for a few hours as we use the backup search cluster.
 
ah, thnx for the update
 
gbn
1:55 PM
@TomV I would add an extra bit field to remove ambiguity.
 
@gbn or two bit fields in this case, one for "unknown" and one for "not applicable"?
 
gbn
@MaxVernon That's the rub, isn't it. I'd only have one for "not supplied" or "invalid data".
Or, more correctly, "don't rely on this value. garbage in, no idea"
and then only if I needed it. in most cases NULL is enough for most stuff I've worked on
I only did it once IIRC
 
There's also the option of using a separate 1:1 table. If there's no entry, it's "not supplied", if there is a NULL, it's "not applicable".
Or is this what 'cube was talking about? I'm not sure I understood that bit about 6NF well
 
@gbn But you think you got away with it?
 
gbn
2:11 PM
@TomV Maybe. Is there a time limit on this kind of crime? I just admitted it on a public forum.
 
@gbn You reminded me of "I mentioned it once but I think I got away with it"
 
@MaxVernon lots of people seem to dislike canary values
 
@sp_BlitzErik it's true... they can be problematic, especially if the meaning is hidden.
 
gbn
@MaxVernon also throw in implicit conversions '' = 0 = 19000101 for when datatypes are managed badly
 
@ypercubeᵀᴹ I would vote that up if it were an answer
 
2:26 PM
@MaxVernon problemaaaaaaaaatic
 
@sp_BlitzErik I suppose one way to "self-document" the canary values would be to include a check constraint on the column showing the valid value ranges. Something like:
    CREATE TABLE dbo.Items
    (
        SomeValue int NOT NULL
        , CONSTRAINT CK_SomeValue
            CHECK (
                SomeValue = -2147483647 /* Unknown */
                OR SomeValue = -2147483646 /* Not Applicable */
                OR (SomeValue > 0 AND SomeValue < 2147483648)
                )
    );
I'd probably not do that on a system that had a large number of transactions per second. I'd do that.
 
Someone will still SUM the values.
 
gbn
You'd lose the "null bitmap optimisation" in some queries, anything involving IS NULL for example
 
@PaulWhite that's very true!
programming is hard
 
8 hours ago, by sp_BlitzErik
> Concurrency is hard; sorry about that
 
2:39 PM
you quoting me, quoting you
 
neat huh
 
gbn
@PaulWhite probably better that way
 
@MaxVernon SDLC in a picture
 
@KrisGruttemeyer no doubt.
 
2:56 PM
@sp_BlitzErik What do chameleons sound like?
@JackDouglas long time no see.
 
Yeah don't think we need that
 
@ConcernedOfTunbridgeWells did you have pleasant drinkies?
 
@JackDouglas Not yet. The guest of honour couldn't make it.
 
Who's that, Phil?
 
@JackDouglas No. Max Vernon
 
3:18 PM
see ya
 
@ConcernedOfTunbridgeWells our time outside of Tunbridge Wells was mad. I'm glad I didn't commit to coming since it would have been hellish trying to fit that in. Still, sad I didn't get to meet you all!
@sp_BlitzErik I added a link to your blog post
 
@MaxVernon which one?
 
about the canary values
I mean I added a link to your blog post in my answer
 
3:35 PM
oh, hahaha
 
4:09 PM
any clues as to when 2017 dev edition will be available?
 
does now count?
 
no links for you then, monkey man
 
hooooo hooo hoooooo hah heh haaaaa hoooooo
 
@sp_BlitzErik link plz
thx
 
4:25 PM
moonwalks
 
4:51 PM
@JoeObbish well the link just worked for to get the installer (SQLServer2017-SS...exe): microsoft.com/en-us/sql-server/sql-server-downloads
installer download I should say.
 
 
1 hour later…
6:06 PM
:40317919 there aren't a lot of RedShift people in this room; you may want to ask on the Database Administrators main site.
 
:40317919 you probably need to put the user name in double quotes. But please ask a question at our site.
Redshift might be different than Postgres in this matter.
 
6:25 PM
@MaxVernon follow up comment: "a unique index on a string column is a terrible idea!"
:D
 
:-D. Stabs self to death.
 
6:36 PM
@MaxVernon and @sp_BlitzErik doesn't 250ms sounds kind of big?
for 5m rows...
 
it does to me... which is why I mentioned checking the execution plan.
I guess it depends on how busy the system is. perhaps there is some blocking ongoing. perhaps the 250ms was a sample while they were doing inserts. There are so many variables not mentioned by the OP.
 
I wonder since it's "filename" that they might be really long or they use nvarchar(max) or some big value.
 
could be
which could be preventing predicate pushdown
 
Would it help - in the case the names are really long, say 50-100 characters - to use a hash of the name for the index?
 
totally
here's an example if you're interested
 
6:42 PM
@sp_BlitzErik thnx
Ha, it's 1024 bytes. No, 512. No, it's either this or that ;)
 
gosh
how many disk sectors is that
counts
 
I'd venture to guess the filename column is a varchar(260); at least it should be since that is a fairly common limiting factor for NTFS. Admittedly, the path technically can be up to 65534 characters, however Explorer balks if the length is over 260.
 
@MaxVernon they posted the CREATE TABLE. It's 512
 
oh nice.
ok, so id is the primary key making it not necessasry to be in the include clause.
@ypercubeᵀᴹ d'oh. I wonder if they have a good reason for that.
 
how do you think i could improve this answer to get the bounty?
 
6:50 PM
@MaxVernon I thought that only was true for the clustered index not the pk
 
@TomV isn't it both for op?
 
Will it matter if it's defined as varchar(512) instead of varchar(256). Say the average length is 100..
 
Haven't checked the question yet
 
@TomV yes but the op has it as primary key clustered
 
Link?
 
6:51 PM
1
Q: Reasonable way to predict query performance over time

Kevin VaskoI have a database (MSSQL 2012) that I am using to save data from processed files. We read data from a folder, process it with python and save the results into the database. One of the first things we do in our ETL process is to check if the file has already been processed. We simply do a SELECT i...

 
Thanks. Yes it seems it's both in his case
 
@Max the index and the query is on basename, which is 512.
 
yah, I see that. I'm just pointing it out. Also, 512 for the name of the file is likely to be way overkill, no?
 
I guess. I'm a lousy Linux user, what do I know about Windows?
 
256 should be fine
 
6:55 PM
lol. I wonder what the path limit is for SQL Server on Linux.
@sp_BlitzErik I'm guessing they probably have filenames that are under 20 characters. Just a guess.
 
@MaxVernon maybe they even have a standard filename format :O
 
@sp_BlitzErik I'd put money on it... not a lot, but a bit.
 
@MaxVernon I'm guessing 100.
Who won that bet game we had? The 20xer hasn't returned.
 
i bet on never
so maybe me
we'd need @hot2use to confirm
 
@ypercubeᵀᴹ what be game??? I'm betting that was while I was inundated in wine in France.
 
7:02 PM
Jul 28 at 13:00, by hot2use
user image
 
@ypercubeᵀᴹ oh man, I forgot all about that guy.
 
aw yeah
 
@ypercubeᵀᴹ I wasn't even aware of that
 
^^^^ lol, seems he got the message
 
The ban expired in 7th of September.
 
7:14 PM
> basename - 143, filename - 168
^^^^ character lengths from the OP
@ypercubeᵀᴹ won that one, then.
 
7:30 PM
Banned again?
 
@hot2use no, he hasn't appeared at all.
Max's comment "ypercube won" is referring to the filename size, in the above discussed question.
 
7:53 PM
Nice. @sp_BlitzErik and I won. But the person who won the most was our PostgreSQL specialist.
 
8:34 PM
@hot2use I think the real winner is all of us.
 
8:51 PM
^^^^ not sure why I can't get the RTM version on Linux, but I've added the new Windows version as a separate RDBMS on dbfiddle
 
-2
Q: SQL Server End-of-life(EOL) Tracking/Reporting

thundercougarfalconAre there any tools out there--don't say MAP or Idera SIM--that would help track SQL Server end-of-life(EOL) or patches? And for that matter, Windows Server EOL? I've created an interactive Gantt chart report using dimensional modeling, SSIS, and SSRS, but is there something comparable already o...

Can someone explain how end-of-life tracking is not related to database administration? – thundercougarfalcon 28 mins ago; added 2 comments
John's answer seemed to be 100% on point
I don't know what else to say except to close the question as too vague
Anyone gotta comment for him?
 
9:20 PM
@jcolebrand it's partially in line with administration, but asking about which tool to use seemed to violate the shopping list question rule
 
9:35 PM
yah
I agree
I just don't know what to tell him. Like. MS publishes these things man
 
he should make a calendar table
ahem
ooh
tell him to use powershell
 
hehe
I mean
Powershell IS my jam
I'm literally writing stuff in PS right now
@jcolebrand I know who Brent Ozar is: been to his training. Also, YES tracking EOL is part of the job: that's why Im asking this question! Set calender reminders? Seriously?! Does that logic hold for SQL jobs too?
awwww, he took his ball and went home
But when did he have SQL Jobs in there? Never.
Sigh
 
i wish i could go to brent ozar's training
i hear it's pretty good
do you interact with sql server much with powershell?
 
Eh
just like querying tables, building dbs from scratch for our devs
no more than like 3-400 lines of powershell in my day-to-day that I do, but those are all batch things
Like, write it and forget it
 
what kind of things do you find powershell makes easier?
like if you were talking to a dba who didn't use powershell, what stuff would you tell them powershell can help them with?
 
9:48 PM
So, therein lies the rub
I'm more of a developer dba, and less of a professional dba
I'm definitely the most senior developer here when it comes to knowing what MS SQL is capable of, but I'm not the most knowledgeable DBA in the firm by far. We have like 4 on staff.
So what I use PS for wrt dba work is about getting my devs machines up and running to support our product
I may use it for like ad-hoc backups on a local machine, because I can write the file to disk with a sqlcommand, then PS to move it around
But honestly I wouldn't use it for things like query plans, or anything of that nature.
 
right, yeah, i can never figure that out either
the end result of most demos and talks i see on powershell seems to be that it's an okay tool if you already know how to use it
"so as you can see i wrote this simple script that enumerates all the objects on a server"
::WALL OF CODE::
"here it gets tables and indexes"
::scrolls for 30 seconds::
"here we get constraints"
::frantically hitting page down::
"and finally at the end it writes the info out to a text file"
 
10:29 PM
 
10:44 PM
@Philᵀᴹ played with that this morning. Pretty neat.
 
I just don't need other people helping me type sql
I don't trust most people because I see how they work
how often do you guys rely on some sort of snippet technology for writing your sql queries?
I seem to just write them out by hand everytime I need them but I can also typically type 40-50 wpm coding and 90 when I'm writing longform prose
 

« first day (2463 days earlier)      last day (2405 days later) »