« first day (3110 days earlier)      last day (1757 days later) » 

6:05 AM
Morning
 
6:28 AM
Morning
 
6:54 AM
That's not what I was asking. Let me give you an example of what I'm talking about. The second row in the original dataset is id=2, Name='B', Code=2. Now in the expected output, the second row is id=2, Name='B', Code=1. It looks like it's the same row, only its Code value is different. So what I'm asking is, do you really want to just show the rows in a specific order (based on the input), as you say in your question, or do you instead want to change the values of Code according to a specific pattern (based on the input), as your expected output seems to suggest? — Andriy M 2 mins ago
Josh certainly did a good job implementing one interpretation of the question but the spec is confusing.
Unless I'm missing something and will hopefully be corrected
 
Morning
 
And now they've just removed the original data sample
 
@EvanCarroll sql server?
Morning
 
7:40 AM
Morning
@JackDouglas Yeah that hasn't been made clear - I would assume so given the fact it seemed to affect every other version post 2014
 
8:01 AM
@George.Palacios wasn't sure about 2012 either, is it out of support?
 
@JackDouglas No definitely not
2008R2 EOL was... two days ago? I think?
This is a serious vulnerability so security fix.
Although SP3 is listed as being out of support
 
@George.Palacios yes though it requires direct SQL to exploit. giving direct SQL access is a bit like giving someone shell access — they will probably be able to escalate.
 
morning, from a late train
 
May 11 at 7:24, by Jack Douglas
db<>fiddle is not going to be easy to keep secure :(
 
@JackDouglas True. I would still expect a fix though usually
 
8:44 AM
oof, asked a question on SO proper just now
pray for me
 
Forgive him father. He knows not of his sin.
 
tfw SO actually is the right network for the question you've got -_-
 
mind=blown
how did you find that?
 
I'll add it as an answer, It's been a while since I scored unicorn points on SO :D
 
8:53 AM
:-p
 
@TomV Who says you will get any, though?
 
👋
lol, so simple! 😝
 
@AndriyM I'll unfriend Peter if I don't get any
 
i clearly burned through all the brain power for the day already
time to go back to bed
obligatory:
Gosh I'm Dumb
6
 
I don't think self-flagellation is obligatory here (or at all). But it does seem to be a form of courtesy
sometimes
 
9:01 AM
Or a way to get the outspoken badge
@PeterVandivier tfw The Heap is actually better suited for dumb questions
 
it is very well suited for that :p
in stop the merry-go-round, yesterday, by Peter Vandivier
my participation in this network is a performance art piece about masochism
@TomV it is a bit weird how ubiquitously Google has indexed everything about the prior gist - yet hasn't picked up anything about the new one
the slug is the same - yet if you search for that text string, nothing pointing to the actual, new gist
the slug is also not indexed in github search and i'm not sure if the commit hash is visible anywhere for gists
¯\_(ツ)_/¯
 
Maybe it will now that there is a link pointing to it
 
i need to get tf out of this rabbit hole
yea that would make sense
 
 
2 hours later…
11:04 AM
screams at keyboard
0
Q: MSSQL over the internet but we connect over RDP

orcaWe connect throguh RDP to our ERP solution which uses MSSQL 2008, right now I can see on windows logs and SQL logs that we have a HUGE amount of connection attempts to sa user and results in slow connections to us, users. Since we connect through RDP and both ERP and DB are on the same server, I...

 
 
2 hours later…
12:50 PM
@AndriyM Self-flagellation is definitely not required. Anywhere, really.
BTW, I eventually asked my question.
What is "stop the merry-go-round"?
 
A dark, dark place that men fear to venture
@PaulWhite Is there anywhere I can see what other magic links are available?
 
The Markdown Help should probably list them
 
It seems to list the ones that work on every SO site, not the site specific ones
 
> You can use the same method to notify any editor of the post, or – if this is the case – to the ♦ moderator who closed the question.
^^^ Don't remember I knew about the part I highlighted in bold
(and I think the "to" is redundant there)
 
@PeterVandivier They start coming in, the second one doesn't have an "in cache" arrow yet so it's pretty new in the index
 
1:19 PM
:p
i love that google saw the internet archive project and thought "yea, i guess we can do that too"
 
1:33 PM
@PeterVandivier yes
 
i've been having a lot of difficulty with it lately as well
the official documentation is sadly difficult to parse for "general case" use
 
Talking about OPENJSON?
 
It's probably the worst idea I've seen in a long time.
 
> it's not perfect so we should burn it down
wise words
any postgres pros on deck have an handy bash script for "list all wal segments after {this-one}" ?
 
1:37 PM
The query language is half in DSL which you provide to OPENJSON and the other half of the json query is in the sql query itself. Moreover it cant handle some cases at all so far as I can see it -- at least not without writing a conditional self-join based on the type.
 
sadly there's no "reverse" button on pg_archivecleanup -n
and i'm trying to avoid doing hex math in bash
 
2:01 PM
When they first introduced XML parsing in SQL Server, they gave us OPENXML, which was arguably even worse, because it required calling system stored procedures before and after using OPENXML. Then they implemented XPath and life became easier. I take it, their giving us OPENJSON essentially means they haven't settled on an established (as in "accepted and used by many, or even most, major vendors") XPath equivalent for JSON to implement in SQL Server
 
2:17 PM
@AndriyM tbh, trying to figure out general "jpath"-y set of rules is what i've been toying with lately
4
Q: Find Ancestry From JSON

Michael GreenI have a hierarchy that looks like this: As JSON in TSQL it is this: declare @Employees nvarchar(max) = '{ "person": "Amy", "staff": [ { "person": "Bill" }, { "person": "Chris", "staff": [ { "person": "Dan" }, { "person": "Emma" } ] } ] }'; ...

since we were talking about it for that question
and i remember a bananas tvf i used to used for XML that did something similar IIRC
it seems like if you're able to unwrap the entire blob into key-values pairs you should also be able to build a "navigate to this node" path on the way there
way less intuitive than you might hope though, at least for me
it's not super apparent which node types are visible to the second argument of OPENJSON, and which need to be traversed to from the WITH block
:(
 
381
A: Add data.SE style "magic links" to comments

balphaMost of these now work. My comment below has the following markdown source: On [main], you are expected to write proper English (as advertised on [english.se]), but here on [meta.se] it's more important to have freehand circles, so please [edit] your post, otherwise I'll have to flag you (see...

 
There should be a magic link to the magic links
Thanks also
 
@EvanCarroll are you sure your premise is correct? i don't think [ 7,2, [6,7], 2,10 ] unwraps into a strictly flat array
i do most of my json transversal after sucking the blob into Powershell objects though
 
It doesn't. I want it too.
 
2:23 PM
so i definitely have a "way of thinking about it"
 
@George.Palacios Are you saying I'm not a magic link
 
You're the magic linker surely
 
I'll take that
 
@EvanCarroll dbfiddle.uk/… naive solution, hold please for the recursive one
 
recursive music plays
 
2:29 PM
Unless you only needed the one level deep?
 
0
A: Flatten array with OPENJSON: OPENJSON on a value that may not be an array? [ [1] ], vs [1]

Denis Rubashkindeclare @ex nvarchar(max) = '[ 7,2, [6,7], 2, 10 ]'; ;WITH cte AS ( SELECT * FROM OPENJSON(@ex, '$') AS j1 ) SELECT c.[key], ISNULL(v.value, c.value) FROM cte c OUTER APPLY ( SELECT * FROM OPENJSON(c.value, '$') AS j1 WHERE c.[type] = 4 )v ;

recursive solution
 
alas i've been scooped
2
back to bash and for-loops and hexadecimal math 🥺
chief-iron-eyes.gif
 
2:50 PM
@PeterVandivier Quite acrostic of you
 
woah, vocabulary.stackexchange alert
;p
 
damnnnnn them wordz
 
3:08 PM
@EvanCarroll Not really
It's the same as Peter's "naive" solution
 
I'm kind of tough on time right now, I'll check it out later tonight.
 
@PeterVandivier No you haven't, see above
3
 
oh snippy snappy
aw man... now i have to clean up my query
the things i do for unicorn points
 
3:36 PM
2
A: Flatten array with OPENJSON: OPENJSON on a value that may not be an array? [ [1] ], vs [1]

Peter VandivierIf you are strictly confident that your nested arrays will never go deeper than N levels, you can completely unwrap the array-of-arrays with N uses of APPLY. If you need to handle for arbitrary nesting levels, you can unwrap the array-of-arrays recursively using something like the following, whic...

 
4:09 PM
0
Q: Is this PostGIS database design question better suited to the DBA site or the GIS site?

AzendaleI asked the following question on the GIS site: https://gis.stackexchange.com/questions/328463/postgis-proper-way-to-model-object-that-follows-sections-of-another-objects-pa Is that the best place for it, or is it better to have it on the DBA site? It feels like I might be getting a bit deep int...

 
 
7 hours later…
10:50 PM
oh gawd, here we go again..
 
11:08 PM
I answered that question on PostGIS
 

« first day (3110 days earlier)      last day (1757 days later) »