« first day (1582 days earlier)      last day (3292 days later) » 
03:00 - 21:0021:00 - 00:00

3:01 AM
We get a state-wide holiday for a horse race. First Tuesday in November. Gottaloveit.
2
 
 
5 hours later…
7:37 AM
@billinkc really?
 
 
2 hours later…
9:08 AM
@billinkc snooker is awesome. And very difficult. The world championship final was yesterday. Was an amazing match
 
@Phil and I missed it completely
 
It's on iplayer :P
 
10:02 AM
Not only they posted a crappy question but couldn't wait for half an hour. Posted another, almost identical.
-2
Q: Query to update datetime field with yesterday's date

SerazCan you tell me the sql query to convert the datetime field from which current date to be updated to previous date and time part as 21:00:00:000 adjusted to GMT

 
10:33 AM
@ypercube One is closed, the other nearly so.
 
10:47 AM
room topic changed to The Heap™ - Consultancy ©®: General on- and off-site discussion for dba.stackexchange.com [mysql] [nosql] [oracle] [postgresql] [sql-server]
The tags were probably overdue a bit of pruning, no?
 
Yes.
 
Hello . Is it allowed to reference here to a SQL (ITVF + CTE) question ?
 
11:08 AM
@RoyiNamir do you mean to 'ask'?
if so then probably 'yes', though I don't know what ITVF means...
 
@JackDouglas In Test-tube Vitro Fertilisation?
 
@Vérace ha, or IVF filmed for ITV.
 
@JackDouglas inline table-valued function, probably
 
11:29 AM
1
Q: Why was the DelimitedSplit8k udf was written with 2X (cartesian product) in SQL server?

Royi NamirI was asking this question about writing fast inline table valued function in sql server. The code in the answer is working but I'm asking about that part : It is clear to me that he wanted to create many numbers ( 1,1,1,1,1,...) and then turn them to sequential numbers (1,2,3,4,5,6....): ...

Inline table valued function
 
 
1 hour later…
12:35 PM
@swasheck Once, I had a cow-orker who was a bit of a sci-fi nut and wanted to know which camp I sat in (wars vs. trek). I don't think I have any particular preference now, but 7yo me was definitely a star wars fan. I even got second place in a lego competition with an X-wing and a Tie fighter, something like 25 years before Lego actually made kits for them. Uphill both ways etc.
However, I have since come up with an idea to offend both Star Wars and Star Trek fans. Someday when I have a bit of spare time I will get a star destroyer kit (and I'll cannabilise my Millenium Falcon, so there) and make up a Lego [Type-S](http://www.freelancetraveller.com/features/gallery/mag/types.html).
If you're enough of a geek to actually know what a Type-S is then you just earned your nerd cred.
I just saw that.
 
(scrolled up a bit :D)
 
@ypercube Depressing isn't it. I voted as your dupe, but there were already 3 votes to migrate to SO, so off it went.
Maybe the other 3 thought it was too basic for dba.se
 
12:50 PM
Perhaps we can convince @bluefeet to send it back ;)
 
I was lazy to look for a duplicate and it was definitely too basic
 
Back to the office today. 😢
 
The following was spotted on Amazon.com
Look at all familiar?
 
1:27 PM
@ypercube Agreed - any question more suited to DBA.SE I can't imagine.
 
@ypercube I can reject it if you'd like
oh and good morning all
 
@bluefeet welcome back :-)
 
@Lamak thanks
 
so, did you enjoy your vacations?
 
yes, it was awesome. relaxing, etc. Didn't want to leave
 
1:47 PM
Liver propose you leave?
 
@bluefeet nice, too bad vacations have to end
 
@billinkc Well it definitely wasn't really happy with me after the 1st few days. We had open bar during the "work" portion of the trip
 
You and your spouse recharged and ready to be back at it or do you need a vacation to recover?
 
Recharged? sort of. Ready to be back? Nope.
It was the first vacation in almost 3 years. I could have used a few more days
 
@bluefeet how long were you gone?
 
1:59 PM
@Lamak 8 days
 
yeah, not enough
 
2:27 PM
From Twitter yesterday:
Imagine, for a moment, what you could accomplish if you had the persistence and drive of the Adobe Acrobat Reader updater
 
That's deep
 
Nobody has that amount of persistence and drive :P
2
 
Someone who programmed it might, potentially.
 
2:42 PM
he/she just automated their persistence and drive, in order not being in the need for having them
so meta
other than that, to me it occurs that sqlfiddle does not like running queries ATM
 
> Process ID 52 attempted to unlock a resource it does not own: OBJECT: 2:60:0 . Retry the transaction, because this error may be caused by a timing condition. If the problem persists, contact the database administrator.
 
You should really get a professional in there
 
3:07 PM
no doubt
 
No, I made the project in my other pc, then just used open project and opened the project. I got errors stating that someone else had made the project and it had problems with decrypting xml etc. So I changed the ProtectionLevel of the project and packages to DoNotSave, then received the errors above. Then I changed project protection in it's properties menu to EncryptSensitiveWithUserKey and removed all the "DTS:ProtectionLevel="X"" from the all the packages view code. Then every packages was set to EncryptSensitiveWithUserKey by itself. But I still get the error that they are not the same — F4LLCON 4 mins ago
I noticed I was sinking in the mud so I got out a shovel and dug furiously
 
I can dig it
 
I should change my avatar to The Shoveler from Mystery Men
 
@MikeFal are you doing lunch today?
 
@swasheck Ja wohl. I'm bringing the awesomesauce.
 
3:21 PM
I'm not available
 
cool. neither am i.
 
awesomesauce--
 
well. i guess i dont have to read the books now
Today I would just like to say: I'm really sorry about Fred. *Bows head in acceptance of your reasonable ire*
 
who's Fred?
 
3:26 PM
he's too sexy for his shirt
 
Right
 
well-said
> SQL Server 2016, in preview this summer, takes a major leap forward with a database and analytics platform that provides breakthrough performance for mission-critical applications and deeper insights on any data across on-premises and cloud. Key capabilities include enhanced in-memory technologies with real-time operational analytics, new security and encryption technologies, built-in advanced analytics with the R language, and mobile BI for on-premises data.
> The new Stretch Database capability is an industry first that allows for cost-effective access to historical data by dynamically stretching data to Microsoft Azure.
 
3:44 PM
@swasheck and JSON support!
 
@JackDouglas eh? say it isn't so
 
yeah. found that
also in there ...
> It is also integrating PolyBase, an existing Microsoft tool that lets you use SQL queries against large non-relational databases such as those stored with Hadoop. Previously, PolyBase was only integrated with SQL Server Parallel Data Warehouse edition.
 
@JackDouglas they wanted to follow PostgreSQL
 
There we go.
 
3:57 PM
@dezso i understand the move for the sake of developers ... i am just going to hate to see how the devs ruin this through overuse
 
@swasheck in every way you allow them ;)
 
But just think how much revenue this is going to bring in for the product? We'll now be CPU bound and since we're buying by the core, it's BRILLIANT!
3
 
I still have never seen a CPU bound SQL Server.
 
Challenge accepted. Get me in touch with Xero HR
 
@dezso And rightly so. PostgreSQL has been an innovator since it was first built in the 1980s. Quite a few features such as extension APIs and spatial indexes (to name a couple) got their start in it.
Oracle, DB/2, Informix, SQL Server and many others all follow in the footsteps of PostgreSQL.
This is, of course, because PostgreSQL actually started out life as a research system built precisely to develop those capabilities.
</historylesson>
Get off my lawn.
 
4:03 PM
love it
@MikeFal i have one
 
@swasheck ORLY?
 
I forgot that @billinkc wasn't going to be in my session in Madison. I was really hoping someone would catch that my SQL Instance name is BMO
 
@MikeFal yes. garbage queries
 
I have just discovered a completely pointless object: bubble wrap that doesn't pop.
 
WITCHCRAFT!
 
4:05 PM
@swasheck Your garbage queries must have garbage plans
 
they do
 
@swasheck Sadly, it appears to be by design. The cells are interconnected and appear to be filled with gas under some pressure. Why? Why?
 
@ConcernedOfTunbridgeWells sounds like me after too many beers
4
 
@swasheck Remind me to stand upwind.
 
Okay rally time. Tonight we make a comeback.
Or we get routed in the second by the hawks again...
 
4:11 PM
@ConcernedOfTunbridgeWells Pretty sure that would be a <DIV> with class=historylesson these days...
 
@Phil unless it is written by @MikaelEriksson
 
4:28 PM
lazy
-1
Q: Jr. DBA With Query From Hell

MaricopaJoeI have a query that the vendor will not change. The query takes 4 hours and of course slows down the entire application. Has anyone run into this? Query Code Here

 
that list of declared variables is already suspicious
 
@bluefeet and maricopa, to boot. you will never find a more wretched hive of scum and villainy.
 
@swasheck I guess I better move
 
:D
@bluefeet i've been saying that for a while
 
I'll just pack my stuff and move back to Hawaii
 
4:32 PM
sounds awesome
 
@bluefeet That's ADP, they don't like it when you touch things (similar to my wife, waka waka).
 
@bluefeet doomed is mor like it.
@JackDouglas if the question has anyone run into bad vendor code then the answer would simply be yes :) — Zane 26 secs ago
Nooo I'm too late to fix that spelling issue.
 
4:48 PM
@Zane yeah. it's spelled MOAR ... duuuhhh
 
5:03 PM
@PaulWhite ... i have a question and you're my go-to for off-the-beaten-path sql server things.
 
I've got some weird permission thing happening in SQL Server that I can't understand why. We've got a role that has access to 2 databases. In one of the DBs it has access to a proc that selects from the other DB. I'm trying to set up a new role with the same permission. I've granted the same execute permission to the new role but it is throwing an error that it cannot select from the other DB.
The old role doesn't have anything specifically granted to it in the 2nd database which is weird
 
not even the public role?
 
Ahh, I think I've found it
 
JNK
5:19 PM
If you don't have cross-database chaining set up it needs to be in both dbs
 
5:33 PM
@swasheck Fire away.
 
Watching the SQL Server 2016 demo. Seems like there is some cool stuff in here.
 
@PaulWhite how do you go about getting information on undocumented things? i've noticed a peculiarity with sys.dm_db_stats_properties_internal but it's undocumented so i'm not sure how much traction i'd get with google.
(and yes ... i've read the dbi link on the dmv)
 
@swasheck It depends on the context. What struck you as 'peculiar'?
 
@Zane Do they have a demo of running R code in SQL Server yet?
 
They had mention of it.
 
5:48 PM
@PaulWhite know what? i think it may have been an issue with the patch level. i'll do a bit more investigation. the particular peculiarities are that i get two partition_number = 1 for RANGE RIGHT partition functions ... and the modification_counter doesnt update when i update one partition. however, thats on CU5 ...
 
Ok.
 
i'm looking on a CU6 example (though it's a RANGE LEFT partition function) and those seem to be more ... expected values
so anyway, the question stands ... do you just have to be "in" with someone to get info on undocumented stuff?
 
It really depends. 99 times out of 100 if I learn something like that from someone I'm bound by NDA not to share it - at least until it is announced or written about publicly by someone who is allowed to.
 
@PaulWhite fair enough and i figured as much
 
@swasheck In the specific case of the dbi blog, yes this happens: people are allowed to share stuff if asked, but it might never appear in official documentation for supportability reasons. To that extent, you have to (a) be lucky; and (b) have access to someone like that, for example via a paid support agreement.
OTOH there have been occasions in the past where people have shared stuff they should not have, and got into serious trouble for it.
 
5:54 PM
Oops! Stretch table didn't like the IP address.
 
@Zane What are you playing around with there?
 
I'm still just watching the Ignite Demo.
 
RDPing into Satya's laptop
 
The demo they were running just pooped. Happens to the best of us I suppose.
 
Ah you're watching a demo. OK.
 
5:57 PM
@PaulWhite Yeah I'm not trying it out or anything.
 
6:26 PM
@Zane that would be impressive considering the fact that it's not yet arrived for public preview
@PaulWhite thanks
 
@swasheck Was it you asking about tempdb allocations?
 
@PaulWhite it was. thanks!
holy crap. ring buffers.
should have known
 
6:56 PM
@swasheck You don't know what kind of connections I have
 
fair enough
 
Connections made in back alley dealings don't count
 
@billinkc Just because I trade sex for those connections doesn't mean I don't have them sir.
 
Zane the lot lizard
 
lmgtfy
 
7:01 PM
Okay So I'm going to post a fairly large query and then delete it. I want to make sure I'm not missing anything.
Okay so I made a comment in that query. What the hell is the point of the items below that line. If the output is already determined?
I just realized how impractical that is to look at in history.
It sets all these variables but then uses none of them...
 
@Zane can you post it to a sqlfiddle?, I can't see the formatted query
 
Or pastebin or something
 
JNK
yeah
unreadable
 
Search for -- replace with \n-- check regular expressions
Or not
 
Probably not. I'll have to change it so I don't break any company policy about posting code.
 
JNK
7:06 PM
@Zane make it a private pastebin
 
@Zane but we are like....heap consultants, we abide to a confidential standard
 
Does that work?
 
it asks for you to login
 
Never used that before sooooo.
Try now
 
BZZZZT
Please rephrase that in form of "GIVE IT A TRY"
 
7:13 PM
@Zane BOOM
 
I feel like I could just turn this stupid function into a subquery and be golden.
 
@Zane Seems pointless, I agree.
 
pastebin is blocked here but based on parsing the deleted, is @oldloannbr really the only thing this does?
 
It's clearly doing a lot of work but that work is never used.
 
JNK
yes pointless
 
7:20 PM
I must have read that a solid 30 times now assuming that I was missing something.
 
@billinkc Yes it's a scalar function that ultimately returns only @OldLoanNbr.
 
pointless indeed
 
but after it get's @OldLoanNumber procedes to do a great many things....
 
The old loan number is the content of acqloannbr until we find a space where the LoadMasterId is found on some other table. Yeah?
 
@billinkc @OldLoanNbris assigned in precisely one place. There is a possibility of a missing assignment at the end, from @OldLoanArchiveLoanID but that would mean the function never worked correctly. Which is plausible, I grant you.
 
7:27 PM
Nope. The only thing they want back is OldLoanNumber. At least for the process I'm using.
 
Yet another example where the quality of the code is inversely proportional to the density of NOLOCK hints.
@Zane Might it have been a copy 'n' paste from another function?
 
@PaulWhite inversely? as the density of nolock goes up, the quality goes down, right?
 
That's what I said ;)
Eventually :)
 
silly me. i was imagining things again
 
You really need to get that checked.
 
7:32 PM
@PaulWhite Must be something like that.
I just wanted to make sure I wasn't going banana's.
 
Another of my favourite things about functions. Advertised as 'making code more reusable', but in reality they never quite are, resulting in close-copies of dumb code in multiple dumb functions. </rant>
> get's // banana's
Someone needs to peer review your apostrophe usage
@Zane It certainly looks suitable for conversion to an in-line function.
 
@PaulWhite eats, shoots and leaves
 
Quite.
 
Version 8
SQL Server. Version 8 to be exact. — knot22 15 mins ago
 
exact
 
7:37 PM
Always good to be precise.
 
So, which one of you started heapanalytics.com ? :)
Needs 2 more head-shots:
-1
Q: DBF error.The database cannot be open

linomiletoI have a software call Kodak Trophy(database program).This program stores patient data with x-rays. Now it is giving an error saying that the database cannot be open. When I try to reindex a codebase error appears with the following error Error #:-210, Error #:94003. Unrecognized or Invalid Fi...

 
I tried to start PeepAnalytics.com but I kept eating the mascot
 
@bluefeet Is it my imagination or is the 'answer' there wrong in almost every possible respect?
 
@PaulWhite I'm testing out the logic in a subquery version right now.
 
oh, Extended Events, how I love thee.
 
7:46 PM
@PaulWhite honestly, I didn't even read it :/
 
@MaxVernon i actually quite enjoy them
 
Trick question???
0
Q: Calculating values from three related tables, without using join or union

Ashraf AbusadaI have a simple basic three tables on SQL Server database: What is needed is to get the quantity available, without using joins or unions which is calculated: Quantity Available = Items Opening Balance - Items Delivered + Items Received Any Ideas are welcome.

 
@bluefeet That's my standard MO on SO, but you're a mod ;)
 
@swasheck mee tooo. I actually wasn't being facetious. Hard to believe, I know.
 
Assigning parameters to local variables to avoid sniffing was the standard workaround before OPTIMIZE FOR UNKNOWN and trace flag 4136 became available. OPTION (RECOMPILE) does not disable sniffing, it extends it to become parameter embedding. I know what you meant to say here, but it's still not what you actually ended up saying. — Paul White 31 secs ago
@MaxVernon Assume it is an assignment question where the goal is to use subqueries.
 
7:49 PM
@bluefeet 2000, i'd guess
 
@billinkc You are not helpful ;)
 
@PaulWhite ahhhh.
 
@MaxVernon WhoTF upvotes that?
 
@billinkc I know, right! It certainly wasn't me!
 
@MaxVernon not hard to believe ... just stating my position
 
7:54 PM
@swasheck all good!
 
8:20 PM
@bluefeet how's you first day back at work?
 
@Lamak no comment
 
@billinkc Seemed like a reasonably clearly-asked question to me.
 
@bluefeet I see
 
I'm generous with my question up-votes.
 
@Lamak I'll just say I wish I was still on vacation
 
8:23 PM
"How do I shoot myself in the foot" is a slightly different question than "I am trying to shoot myself in the foot because I'd like to test out my body armor"
 
@bluefeet soooo, I got an email this past weekend from SE about the cm thingy, it says that they know that it has been months, but if people are still interested, that they resubmit an application
 
@Lamak nice
things tend to move a bit slow
 
yeah, it means that the spanish SO could actually be close to exist....the weird thing is that I did submit an application again following the link they send, and got this automatic reply: "You have previously applied for this position. A new application has not been submitted."
 
@PaulWhite ... ugh ... i was wrong. patched everything to CU7 and the dmv is still providing strange results. it's like a RANGE RIGHT partition is throwing it for a loop
 
@Lamak that's a bit odd
so you're still interested then
 
8:27 PM
What's Spanish for "¿What have you tried?"? I can win all the reps with it!
6
 
@bluefeet yeah, I now don't know if the application went through or not
 
@Lamak ping Shog and ask him
not sure if he'll know though
 
@Phil You have the upside down question mark, seems legit to me
 
@bluefeet I'm scared of shog
 
@Lamak you'd work with him if you got it
you can't be scared of him
 
8:28 PM
@Shog9 is a puppy
 
@bluefeet I'll try not to
 
he doesn't bite
 
@Phil the literal translation is "¿Qué has tratado?", but I think it would make more sense to ask: "¿Qué has tratado de hacer?"
or "¿Qué has intentado?"
 
QQ
 
QQ?
 
8:33 PM
QED
 
@Lamak Supposed to be eyeballs. Seen people with vanity plates like LQQKING or something dumb like that
 
Hi. which tool /query can tell me : " you got many unnecessary.unused indexes" - remove them ...?
 
@RoyiNamir sp_BlitzIndex
 
@RoyiNamir well, you go right to the point
@RoyiNamir which tool?, maybe @billinkc
 
@RoyiNamir which RDBMS? Saying MySQL is punishable by death
 
8:38 PM
(sorry) sql server r2 2008
 
@Lamak I am incapable of producing any actionable output
 
that's true
 
Unless you mean legallly actionable.
 
Thank you Paul for the link/answer
 
I'm sure many such scripts/tools are available, that's just the first one I recalled.
Clearly, Brent's advertising works.
Ooo! Site is offline!
 
8:40 PM
(works here {the link you provided})
 
I mean dba.se is offline.
 
d'oh.... and just as I was going to plant an answer!
 
everything is down
2
 
apparently not chat ;-)
 
8:42 PM
Chat is bulletproof.
Or cached.
 
it musta been my crap answer that brought it all down.
2
 
BOOM!
 
Careful, you summon the green one with that
 
how do I explain to my boss that this is wrong ? ( he is so stubborn) :
 
I may have been subliminally suggesting that Vertica brought the SE network down.
 
8:43 PM
insert...

select top 1 scope_identity() from mytable --WTF ?
I gave up of fighting him
 
@RoyiNamir With a clear and well-reasoned explanation, wrapped around a brick :)
 
he wants all the sp's ( with identity) to be like this ^
 
We are investigating a network-wide issue now.
 
hadn't seen this image
 
That's big.
 
8:48 PM
@RoyiNamir I think INSERT ... VALUES (SCOPE_IDENTITY()) would do the same and be clearer. His version seems just confusing.
 
@AndriyM but it's not too terribad
 
that's not the same
he's not inserting scope_identity
all we want is to return the scope identity
I jsut wrote "insert..." to demonstrate insertion of identity
 
Ah, I see, it's a SELECT after an INSERT.
 
yes
but he wants to get the identity with select top 1 from table
 
@RoyiNamir What's his objection to SELECT SCOPE_IDENTITY() exactly? Oracle background?
i.e. he would find SELECT SCOPE_IDENTITY() FROM dual acceptable?
If Oracle had scope identity, but you know what I mean.
 
8:51 PM
to his words : " we had some scenarious that incorrect values were returned - so to be on the safe side - USE THIS" ^
annoying...
 
We are investigating a network-wide issue now.
oops
 
the only scenario I could think is when multi insert - but then the query will be :
select scope_identity() from mytable
 
@JackDouglas Old news :)
 
cue the usual jokes about asking for help on SO
 
(I mean when I insert multiple values in one hit.) - and I want to get all the identities
 
8:53 PM
@RoyiNamir No, in that case you would need to use an OUTPUT clause in the INSERT statement.
 
@AndriyM oh yeah, sorry
 
@RoyiNamir that's not what it would do
 
I knew WITH NOLOCK would break SO eventually!
5
 
wouldn't it return all identities inserted ?
(in one hit)
 
@RoyiNamir no
 
8:54 PM
Chat has always been the neglected portion of SO but now who's laughing!
 
(I know about "output" which is a better solution)
 
It would return the last identity value inserted....once per row of your table
 
@RoyiNamir Ask him for details about the 'workaround'. Did he get it from an official source, or just something they tried once when SCOPE_IDENTITY had problems? It is NOT one of the official workarounds for that specific issue.
 
@RoyiNamir Not just better - the only sane one. Before its introduction in SQL Server 2005 triggers would probably be your only option (for multi-insert identities).
 
The only really safe approach to identity is to use the output clause as mentioned.
 
8:58 PM
Paul - no , he didnt get it from any source. he's just stubborn and can't get the fact that he might be wrong.(he's not a dba - jsut a c# programmer which knows sql)
 
@RoyiNamir I'll go back to my original suggestion then. Hit him with a brick.
 
hhh lol
 
Stack Overflow is back.
 
03:00 - 21:0021:00 - 00:00

« first day (1582 days earlier)      last day (3292 days later) »