« first day (2250 days earlier)      last day (1904 days later) » 

12:04 AM
@EvanCarroll with my answer?
you never answered it
I'm going to though
welcome to jump in though =)
didn't mean to be all like, "IT'S MINE, I FOUND IT."
community just bumped it
@EvanCarroll it's your treasure?
I share.
12:19 AM
@MaxVernon Nope. I don't like social media in general. Hopefully this site doesn't count as social media
Antisocial perhaps
that's not very nice!
I think I can fool myself as long as I don't change the default avatar or put anything in the biography
I wish I had more time to answer questions during the typical US work day
but it looks like a few interesting questions remain
"How make SQL to use merge join without hint"
12:40 AM
iptables users?
@JoeObbish I wish I had more time full stop.
@PaulWhite hire a secretary! sleep less!
that's all I got
So why would this sudo iptables -I INPUT -p tcp --syn -m conntrack --ctstate NEW --ctstatus CONFIRMED --dport 5433 -j LOG register two entries for every connection?
[598519.458578] IN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC= DST= LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=49795 DF PROTO=TCP SPT=58554 DPT=5433 WINDOW=43690 RES=0x00 SYN URGP=0
[598520.875428] IN=lo OUT= MAC=00:00:00:00:00:00:00:00:00:00:00:00:08:00 SRC= DST= LEN=60 TOS=0x00 PREC=0x00 TTL=64 ID=65392 DF PROTO=TCP SPT=58560 DPT=5433 WINDOW=43690 RES=0x00 SYN URGP=0
ah source port
psql is just doing it. =(
1:25 AM
@JackDouglas You're welcome! -- Eh? What? I can't remember if I do something. Ha, ha. -- By the way, good to see here!
A: Best design to reference multiple tables from single column?

Evan Carroll Here's my problem: different brands of clothing require differing information. What is the best practice for dealing with a problem like this? Using JSON and PostgreSQL I think you're making this harder than it needs to be and you'll get bitten with it later. You don't need Entity–attribute...

@PaulWhite =]
3 hours later…
4:40 AM
May want to VTC this and move it over to DBA.SE
Q: percentiles from histogram data

user3206440The following table captures student grade data over a number of exams. CREATE TABLE grades AS SELECT name, exams, grade_poor, grade_fair, grade_good, grade_vgood FROM ( VALUES ( 'arun' , 8 , 1 , 4 , 2 , 1 ), ( 'neha' , 10 , 3 , 2 , 1 , 4 ), ( 'ram' , 5 , 1 , 1 , 3 , 0 ), ...

2 hours later…
6:41 AM
The kinds of edits I have to endure on this network.
Moderators that HATE free speech.
Bad dudes.
6:53 AM
@EvanCarroll Not at all. I was responding to a flag. Feel free to improve my edit or roll it back if you disagree that it improves the answer. I might not be able to keep my upvote though.
@EvanCarroll Strike me down with all your hatred, and your journey towards the dark side will be complete.
7:30 AM
7:52 AM
Uh, do I get banned if roll back your edit?
I'd rather have my education about Nazi designers than an upvote.
Because.. you know all that stuff is 100% true.
@EvanCarroll At the same time omitting it doesn't make your post less eligible as an answer or lower its quality. It's not as if you need to tell all that in an answer to a technical question.
Style. etc.
8:12 AM
@EvanCarroll Not for that, no.
But if it gets flagged again, making the edit to save the answer will no longer be an option.
@EvanCarroll Irrelevant. There were a whole lot of people/countries that had relationships with the Nazi Germany. From France, USA, Switzerland and I imagine many more. Your own country invited and used scientists from there, after the war. But I don't feel inclined to add "Nazi USA" in my dba posts.
I'd suggest that if you want to educate people about the history of fashion designers, you do it in chat, on Facebook, the bird network or wherever. It has little place in a Q & A about database design, IMO.
There are other sites/forums for these discussions.
In short, there are other, better ways to be awesome than by inserting irrelevant, even if 156% true, facts into your answers :)
8:47 AM
@ypercubeᵀᴹ I'm from the USA. Do I get in trouble if I refer to it as Nazi USA?
I'm unsure why people flagging historically correct and factual sample data.
@EvanCarroll Well, flags are private, but I can say that the objection was that the Nazi content simply wasn't appropriate or necessary. Given the feedback in here so far, I've changed my mind about allowing you to revert the edit. If you do, I'll reinstate mine, lock the post, and invite you to get community consensus for your position on Meta.
Nah, I'd probably just get banned if I reverted the edit and the post wouldn't get locked and I wouldn't get a chance to post to Meta.
@EvanCarroll No you won't get banned, I'd do what I told you I'd do. Feel free to raise it on Meta now, without the rollback.
Maybe there'll be overwhelming support for your position.
Nahhh you're like one of many in the little junta. I've got enough nasty grams and bans from mods this week.
Besides. If they keep it up, I'll never be able to oust the Microsoft kids from #1.
You seem determined not to be helped. I tried.
9:14 AM
Good news! Forcing a parallel plan to be addressed in an upcoming #SQLServer 2016 SP1 Cumulative Update https://connect.microsoft.com/SQLServer/feedback/details/714968/provide-a-hint-to-force-generation-of-a-parallel-plan #Connect
morning (evening local time)
In What languages SQL Server was written ?
9:29 AM
Microsoft SQL Server is a relational database management system developed by Microsoft. As a database server, it is a software product with the primary function of storing and retrieving data as requested by other software applications—which may run either on the same computer or on another computer across a network (including the Internet). Microsoft markets at least a dozen different editions of Microsoft SQL Server, aimed at different audiences and for workloads ranging from small single-machine applications to large Internet-facing applications with many concurrent users. == History == The...
C and C++
9:42 AM
1 message moved to Trash
I'm always falling in this part. This table is never joined. It's always updated / inserted. And I always look for it with UpvoteId AND ImageId. so Should I leave UpvoteId as primary key with SEED , or should I set both UpvoteId and ImageId as PK ( and leave SEED as UpvoteId ) ?
I mean I could create another Index on both first column
But Maybe It's wrong . I don't know
9:59 AM
If UpvoteID uniquely identifies every row in dbo.Upvotes, it makes sense to make it (or keep it as) the PK. I'm not sure I understand why you are additionally filtering on ImageId.
Things don't get any more unique than a key :)
If UpvoteId is a surrogate, you should have the natural key declared as well.
And if (ImageID, UserId) also identifies rows, have it as UNIQUE as well (or reverse PK-UQ)
e.g. UserId, ImageId (looks like the natural key to me).
@AndriyM There is no access to this table only via UpvoteID. The access is ALWAYS via both first two columns
Paul , and by this way ( as you suggested) I earn also Clustered Index AND PK. Am I right?
It's one option to have the natural key as a nonclustered PK and the surrogate as UNIQUE CLUSTERED, yes.
10:05 AM
Sorry for my ignorance , but what do you mean by "surrogate" ?
@RoyiNamir The IDENTITY column. A generated column that uniquely identifies rows but is added to the natural set of attributes just for that purpose.
A surrogate key (or synthetic key, entity identifier, system-generated key, database sequence number, factless key, technical key, or arbitrary unique identifier) in a database is a unique identifier for either an entity in the modeled world or an object in the database. The surrogate key is not derived from application data, unlike a natural (or business) key which is derived from application data. == Definition == There are at least two definitions of a surrogate: Surrogate (1) – Hall, Owlett and Todd (1976) A surrogate represents an entity in the outside world. The surrogate is interna...
( Oh , I didn't know the term , but I surely knew what Identity column is :-))
@PaulWhite But in this was , I will hurt performance , since clustered index is access faster than non-clustered , no ?
The important point being that making the surrogate unique does nothing to enhance the integrity of the real data. Hence the need to declare the natural/business keys.
@RoyiNamir Ha ha ha no.
A: Difference between clustered index seek and non clustered index seek

Paul WhiteA nonclustered index that has the same key(s)* as the clustered index, may still be useful, because the nonclustered index will usually be smaller and denser. Remember, a clustered index includes all in-row data, so it is normally the widest (least dense) index possible. * The same key columns, ...

:-/ God I don't know what to think.....I always thought it is the case since records are actually ordered on the disk by the clustered index oreder , and now you're telling me I was wrong
The clustered index defines the logical order of the rows (and pages). The physical order can be different.
10:12 AM
@RoyiNamir If you are searching for a single row, the difference between the ci search and the nci seacrh is 1 vs 2 seeks.
Well, strictly it's 1 seek per level of the clustered index b-tree vs. 1 seek per level of the nonclustered index, (plus the clustered index seeks if the nonclustered index is non-covering for the query).
@PaulWhite That answer is heresy according to the Gospel of Matthew ;)
@ypercubeᵀᴹ Indeed.
So the following statement is wrong ?
@RoyiNamir Yes. A common misconception, sadly.
10:17 AM
First result in Google
Not the first time in history.
One last question Please. Can there be here a race condition in the ??????? section ? ( I mean - meanwhile another connection has inserted a row )
    CREATE PROCEDURE [ImageSetUpvotes]

    (@ImageId INT, @UserId INT, @Score INT)
    	       SELECT 1
    	       FROM   Upvotes
    	       WHERE  ImageId = @ImageId
    	              AND UserId1 = @UserId

    	     INSERT INTO Upvotes
Well, think about it. If you send 100 people with the instructions:
- look for a book in a library
- if it isn't there, sit down and start writing it
What do you think will happen, assuming that they are not very fast writers?
Ok So I guess I should use TRAN
A single insert may be a very small book and a computer a very fast writer but there's always a chance that two of them can finish checking at the same time and start writing at the same time.
10:24 AM
@RoyiNamir That's not enough.
A: SQL Server 2012 potential race condition on select or insert

Joel AllisonGET occurs far more frequently than CREATE, so it makes sense to optimize for that. IF EXISTS (SELECT * FROM MyTable WHERE Id=@Id) SELECT Id, X, Y, Z FROM MyTable WHERE Id=@Id ELSE BEGIN BEGIN TRAN IF NOT EXISTS (SELECT * FROM MyTable WITH (HOLDLOCK, UPDLOCK) WHERE Id=@Id ) ...

Ok I'm leaving this room. It makes me feel stupid
@RoyiNamir Is the procedure doing something if the row does exist?
Updates it. But you guys told me that MERGE is Buggy.
No-one is trying to sell you MERGE, though :)
10:27 AM
You could do UPDATE ... WHERE ...; IF @@ROWCOUNT = 0 INSERT ...;.
MERGE would need the same hints to be safe as well.
@AndriyM That's still vulnerable.
@PaulWhite As in "needs some hints too"?
@AndriyM Yes, and a transaction. Otherwise a row could turn up after the UPDATE checks, and before the INSERT.
In the library analogy, you can think of UPDLOCK as marking the found book as reserved. SERIALIZABLE/HOLDLOCK marks the space where the book would go as in use.
On the clustered index thing, even if the pages are in perfect key order numerically (e.g. pages 100, 101, 102, 103...) there is no guarantee (or general likelihood) that they will be physically contiguous in memory or on disk.
@AndriyM Same like in C# that people think that value type are stored in the STACK and reference types are stored in the HEAP ( The latter is true , the former is almost never true)
Probably the first result in Google as well :)
10:33 AM
I must check :-)
This is bad
a tough problem
Q: Only Select Supersets

basketballfan22I am not sure what is the preferred style when talking about tables and their contents, so I hope what I type is fine. If not, I'll be more than happy to edit my question. I have two tables (along with a nonclustered index) that can be created with the below commands: CREATE TABLE GroupTable ( ...

Google should stop it
@RoyiNamir this is the advertised result. The following ones have more correct info
Interesting summaries for open-source projects: openhub.net/p/postgres
10:53 AM
@ypercubeᵀᴹ Do you understand his output? I mean in particular why it includes 1 and doesn't include 95
Oh, never mind
Yes it takes a moment or two to understand the problem.
@PaulWhite you get it?
11:14 AM
Yes I think so
11:33 AM
Is there a way to assign a variable using TOP 1 ? SELECT TOP 1 @MyVar = Field1
@PaulWhite Thank you.
@PaulWhite sorry, Line 14: Incorrect syntax near the keyword 'TOP'.
@McNets Sorry was going from memory. Use:
SELECT TOP (1) @P1 = t.P1
FROM #tbl1 t
AND dbo.SplitCompare(t.C1, @Name) = CONVERT(bit, 'true');
The IF EXISTS(@P1) is incorrect syntax as well.
You probably want IF @P1 IS NOT NULL
@PaulWhite thaks, I know, the whole select was inside Exist() before the error
@McNets the AND dbo.SplitCompare(t.C1, @Name) as well. I don't think SQL Server functions can return boolean.
11:48 AM
@ypercubeᵀᴹ yes, it doesn't works, I've added = 1
Yeah I fixed that up just above as well.
The OP insists he wants to use a CURSOR
Ah, shame. I should be reading the Heap more carefullY!
@McNets that shouldn't stop you from suggesting another route, if you think it's better
He says its a huge table. I suppose he wants to limit the number of processed rows.
Sometimes a cursor is the optimal solution. Not often, but it does happen.
11:56 AM
@McNets The q shows an unnormalized messed up schema.
You might be able to use the new split string function. Or not (was that added in 2016?)
And I think there was another one
SPLIT_STRING was added 2016
It's STRING_SPLIT, but yes, added in 2016.
;) thats
I like english.se so much
A: Nonreligious version of "heaven knows"

SpagirlGoodness knows is a derivation of God knows, so it is still 'religious' but not overtly so. goodness knows 1. No one knows. (A variant of "God knows.") Goodness knows how long it will take for my application to be processed. If you want to go aggressively secular, there is Fuck knows ...

12:19 PM
... where one can use "fuck" freely, eithout fear of moderation. Even to suggest that it's not a synonym of "God".
@Rich i acknowledged that 'goodness knows' was still religious, while noting that the reference was not overt. I have never heard anyone claim that 'fuck' was a euphemism for 'god' before. In this usage it is clearly a replacement for the word 'God' in the phrase, but that doesn't make it a euphemism for 'god'. — Spagirl 19 hours ago
The answer "let's face it" reads best (of the alternatives) to me, but "goodness knows" is still best (and without modern religious implication I would say).
"I admit ..." perhaps?
Doesn't have enough of the same meaning for mine, but it is close.
@PaulWhite Yeah. There seem to be 2 or more distinct uses of "God knows"
"God knows what we'll find there". "Let's face it" and "I admit" don't look nice as replacements there
2 hours later…
2:23 PM
Jack Douglas answered the q I linked above, about the supersets
I can't believe that we'll finally get the ability to properly force parallel plans in SQL Server soon
@JackDouglas I saw that but couldn't create an essay ! — m3asmi 39 secs ago
what does that mean?
@JackDouglas a little thing about dbfiddle...
A non-native speaker of English struggling with the language, I presume
2:39 PM
@AndriyM Could be a french speaker (essai)
@JackDouglas You are inside a edit box that overcome the screen, and you scroll down using cursor keys, text do not scroll up. Simply cursor disappear.
@TomV Nice, seems likely.
Definicions de: essay
a short piece of writing on a particular subject.
Apart from the novels, Sundara Ramaswamy has written several short stories and essays on literary criticism.
sinònims: article, composition, study, paper, dissertation, thesis, discourse, treatise, disquisition, monograph, commentary, critique, theme
an attempt or effort.
a misjudged essay
sinònims: attempt, effort, endeavor, try, venture, trial, experiment, undertaking
attempt or try.
essay a smile
@McNets can you send me a link?
what happens if you type rather than move the cursor?
@McNets fixed :)
2:55 PM
@JackDouglas you're fast man!!
@AndriyM - see the above removed message
other room owners can do that too if you feel like it.
@JoeObbish Well we don't yet know exactly what will be delivered, but one thing's for sure - it can't be worse than having to use an undocumented trace flag.
I do honestly feel sorry for people that don't get to work on vLatest on a daily basis.
Older versions are starting to feel painful.
@MaxVernon Done.
3:11 PM
@PaulWhite agreed.
It hurts to use '05 coming from '12. But vNext is like that times 100.
"It's just faster" is not a joke.
3:59 PM
@PaulWhite My guess is a USE HINT, but that could be totally wrong of course
We still use the legacy CE, even on SQL Server 2016 :)
4:14 PM
Hallo everyone.
I live.
Hi Evan
@JoeObbish Yes one would think so. PREFER_PARALLEL_PLAN perhaps.
@JoeObbish A valid choice. Compat 130 though otherwise?
4:41 PM
700 more rep until I get a GOLD TAG BADGE for postgresql
@PaulWhite otherwise known as DIE_SHAREPOINT_DIE
@EvanCarroll That's quite exciting. And only 100 to earn SILVER TAG BADGE first.
Yes, silver doesn't give me bragging rights. =( useless medals.
I think most of my EXP comes from self-answered questions rather than helping other people. Voluntary contributions to the network.
@EvanCarroll Stepping stones :)
@EvanCarroll Does it? That's highly altruistic of you. Kudos.
the Phone Numbers, and Email data type posts were both very popular as far as the goes
4:51 PM
@JackDouglas is there a dark theme for dbfiddle?
@EvanCarroll So I see.
And all achieved without accurate Nazi facts embedded ;)
Oh come on those haven't been flagged?
No way...
I just assumed whatever mod flagged my Nazi Awareness campaign also flagged my other informative submissions
Guess not
@EvanCarroll just cuz they were flagged does not mean a mod flagged them. Anyone can flag anything they like.
@MaxVernon why would people flag things they like?
@JackDouglas lol. cuz.
I suppose that should have been "anyone can flag anything they don't like"
but that's awkward language to me.
@EvanCarroll I see you've flagged 33 items, so you are aware of how it works.
5:02 PM
@EvanCarroll Ha, no it was a normal user's flag. A moderator wouldn't flag, a moderator would simply act.
I sometimes flag then act
@JackDouglas You know what I meant ;)
sorry yes of course
@JackDouglas this might be prone to race conditions ;)
@ypercubeᵀᴹ He flags with (UPDLOCK, HOLDLOCK) :)
5:03 PM
select flag for update;
Warning: non-Microsoft syntax detected at line 1
@JackDouglas do it,
How do you guys name your Sps ?
@McNets if you give me TeamViewer access to your PC I will ;)
ImagesGetAll / Image_Get_All /GetAllImages  / sp_X ....?
5:05 PM
@JackDouglas I'm terribly sorry, I mean, I did it. ;)
Thank you.
I think I've read somewhere that _sp has to do with master db
@PaulWhite That guy again! Is there something he hasn't blogged about? ;)
@PaulWhite it's SQL standard I think ;)
5:09 PM
@ypercubeᵀᴹ Let me know if you find something!
@PaulWhite Yes, if for no other reason than avoiding the awkwardness of convincing customers to upgrade to SQL Server 2014 but leave compat at 110
still have a mix of 2012, 2014, and 2016
definitely not able to take advantage of many new features easily
@JackDouglas Yep, SQL Standard is very close to being a synonym for non-Microsoft :)
with each month that passes I don't feel as good about continuing to use the legacy CE
@PaulWhite now you are being too harsh — you are thinking of MySQL perhaps?
@JoeObbish That's my general feeling as well.
5:15 PM
@JackDouglas they are adding window functions and CTEs, or so I heard, in the next version
I heard that too
At least MariaDB is adding them - and CHECK constraints, too - and I somehow feel that Oracle wouldn't want to stay behind
@ypercubeᵀᴹ CHECK constraints that work?!
Yes, indeed.
They realized it wasn't that hard ;)
The world is becoming a strange and scary place.
5:37 PM
Q: Gold-badge holders and moderators can now edit duplicate links

Shog9As of a few minutes ago, if you have a gold tag-badge for a tag associated with a question that's been closed as a duplicate, you can edit the duplicate links to replace, add, remove or re-arrange them: These changes are tracked in PostHistory to allow anyone to detect abuse, while the res...

There must be quite a crowd following the main Meta, so many votes in so short a time. I imagined it to have maybe 15 or 20 really active ones, don't know why.
that's not a question!
Meta's different.
if the process works then it works
I shouldn't be one to criticize others for finding workarounds within a system...
5:54 PM
It's funny actually. It's been a point of (some) contention for a long time. The most recent attempt to 'fix' it was not at all well received.
6:07 PM
@AndriyM it's also featured so it appears in the sidebar network-wide
@bluefeet Yes, I realised that just a couple of minutes ago. So, no surprise with this one at least.
@AndriyM shogpuppets!
@ypercubeᵀᴹ Which ones? The 15-20 or all the others? No, please don't answer, I don't want to know :)
@AndriyM It was meant as a joke only. I have obviously failed.
@ypercubeᵀᴹ No, you didn't, I did.
6:21 PM
Not because you asked for explanation (jeagl is our trademark after all) but because it wasn't starred immediately - as I had hoped.
I meant to respond with something funny. Didn't work.
The "I don't want to know" was funny
@JoeObbish That is the flag I hate most of all.
@PaulWhite Curious to hear why. I always thought that the TF that disabled the transaction log was the worst, but I haven't looked at them all.
@JoeObbish I don't talk about it much because it gives it oxygen. But it's dangerous, misleading, and no one should use it ever IMO.
6:33 PM
A: Separate month and year columns, or date with day always 1?

Evan CarrollPersonally if it's a date I suggest always storing it as a date or can be, it's just easier to work with as a rule of thumb. A date is 4 bytes. A smallint is 2 bytes. You can have one date which will support day if you ever need it, or one smallint for year and month which will never support t...

A: Close the loop on "Too Broad"; make the close reason's actual intent reflected in its message

KonamimanThe description of the "Too Broad" close reason has been changed. This is the new text: Please edit the question to limit it to a specific problem with enough detail to identify an adequate answer. Avoid asking multiple distinct questions at once. See the How to Ask page for help clarifyi...

2 hours later…
8:15 PM
@PaulWhite Jack Douglas has edited his answer:
A: Only Select Supersets

Jack Douglas I would like the output to be the following: GroupKey RecordCount GroupScore ------------------------------------- 1 3 9.8 192 4 7.1 Using correlated subqueries is one way to get the output you want. In the instance when ...

He provoked me!
Yep I was notified thanks @MDCCL
@PaulWhite My pleasure. Took the chance to give more exposure to the post as well.
8:39 PM
And why not :)
9:00 PM
I finally got a terribly bad example of a SQLCLR UDT for Email Types working.
Does anyone here who would like me to build a special/ cool CLR function ? I'm going to refresh my mind about that topic (i've did it a long time ago) and it would be more beneficial if it will be useful by someone
a CLR for bcrypt hashing would be kinda cool
9:15 PM
@PaulWhite Ok to use in dev environments purely for investigation?
9:37 PM
can a room owner delete my post that mentions the TF since it's dangerous? thanks
@JoeObbish actually owners can't do that. Only mods can delete messages. owners can move messages to trash, but that just puts them in a different place.
Maybe Trace Flag [Redacted] belongs in the trash
but it's the go faster tf.
Cool, then I can combine it with NOLOCK for ludicrous speed!
9:54 PM
@Forrest weeeeeee!
1 message moved to Trash
Thanks Max
@MaxVernon I think that's actually a pretty cool answer all things considered.
@JoeObbish no worries!
@EvanCarroll thanks.

« first day (2250 days earlier)      last day (1904 days later) »