« first day (1515 days earlier)      last day (3336 days later) » 

1:34 AM
bahahahahahaahahah
user image
4
 
 
7 hours later…
8:27 AM
Mooning.
 
8:49 AM
@Lamak thanks but I have to disagree - the general level on meanness on DBA is much lower than the SE average :)
even the SE average if you strip out SF, which makes quite a difference ;)
 
9:11 AM
@JackDouglas Great! We can start being meaner then ;)
 
10:03 AM
@JackDouglas SF is very mean compared to the rest of SE? (I'm registered there but visit it very rarely.)
 
10:20 AM
What do you think about moving this over here?
0
Q: SQL Server 2014 temp variable update performance

Ben GawiserOkay, so I have a query that looks like this: Declare @Table1 Table (some columns) Insert into @Table1 [QueryA] Update @Table1 set Field1 = A.Value1 from ([QueryB]) A where Field2 = A.Value2 Select * from @Table1 QueryA is a simple query that returns ~150 rows. QueryB is more complex and ...

 
The SE average is not something we want to aim for :)
 
I guess it's either we aim for it or we drag it to our level.
 
@AndriyM Not that interested, it's fairly basic.
The first SO answer is predictably awful though.
 
It made no sense to me, even though I myself have little to say on the matter.
 
It's barely English.
 
11:22 AM
@PaulWhite I thought we were speaking SQL here
 
@AndriyM I think it does have a bit of a reputation
I find the site really useful though - you have to have a bit of a thick skin
 
12:18 PM
The thing I didn't like about SF is that it has a tendency to argument by assertion
DBA.se is pretty good about providing evidence and explanations
 
In the comment thread under the question some of them do link the unwelcoming behaviour with frustration about deteriorating average quality of new questions – something we've been experiencing too.
 
We need to get better at closing/deleting hopeless questions quickly. And placing otherwise duff ones on hold quickly. And reopening improved, previously-duff questions. The system does work, mostly, eventually.
 
21 hours ago, by Aaron Bertrand
user image
 
JNK
1:20 PM
morning folks
 
howdy
 
1:36 PM
hi
 
1:51 PM
hola
 
JNK
2:03 PM
Shameless plug:
nice reading from @AaronBertrand on NOLOCK with #Temp tables
tl;dr version - don't bother
 
But for faster!
 
@MikeFal Aren't you on a plane?
 
Nope, in the airport. DIA
Flight boards in about 20
 
2:27 PM
@paul thank you for the edit. Once I saw all the _dta_ stats I felt compelled to be brief.
 
I wouldn't bother but there are 6 upvotes on the accepted answer, which was posted long enough after the last edit or comment from the OP too, so...
What do you mean by row 0 and row COUNT(*)? First and last row when sorted by val? In your example, two rows have the min val (which is 1), it's the rows id=1 and id=4. Your expected output shows that of the two only id=1 was removed. Why not id=4? And must it really be one row and not both? I'm asking this because the answer you've accepted would remove both val=1 rows from your example data. What was the actual requirement? — Andriy M 3 mins ago
 
2:42 PM
Watch out DBAs, I'm walking into a whole new world of writing potentially bad SQL. My next project is using Impala (Cloudera SQL on Hadoop) to write queries for Tableau reports.
This is the first time in at least 4 years that I am not using SQL Server for an entire project.
 
You never really used it in the first place
/me ducks
 
jerk
 
@AaronBertrand Yep. I dislike long comment threads so I moved the outcome to your answer and removed my side of the history. Works ok I think.
tl;dr y. np.
 
3:27 PM
@mmarie all of these drag-and-drop automagic sql generating reporting tools create some truly awful sql. impala isnt special
 
@swasheck I don't think I'm dragging and dropping, but agree that there are several tools like that. But the flavor of SQL is slightly different and I wasn't really that good at writing efficient SQL in the first place compared to you guys. So it will be a fun learning adventure.
 
3:47 PM
please, please, reopen this (only one vote is missing)
You have changed your question completely... However, a record could take all the values you select in the query. — dezso 2 days ago
 
@MikaelEriksson Ha!!!
 
You agree right ;)'
 
"To all you mods and high reps" < Classic.
Yep.
 
This actually reminds me of a question of my own that I have thought about a bit.
is it possible to do a group by cast(DateTime as date) and avoid a sort
Does not look like it can use an index on datetime column
 
thanks, whoever it was
 
JNK
3:54 PM
@MikaelEriksson Did you GIVE IT A TRY!?
 
Yep but it was a while ago.
declare @T table
(
  D datetime primary key
)

select count(*)
from @T
group by cast(D as date)
 
you're missing FOR XML AUTO
2
 
Ha
Moving rows to another table does the job without sort but...
declare @T table
(
  D datetime primary key
)

declare @T2 table
(
  D date primary key
)

insert into @T2(D)
select cast(D as date)
from @T

select count(*)
from @T2
group by D
 
group by D? ...
shouldn't that be in the insert query?
 
@MikaelEriksson BTW I wouldn't be surprised if the source data did not in fact include a time component.
 
4:02 PM
@ypercube Nope, then I would have the sort in the insert query.
 
@JNK 's dba would also put an ORDER BY on the insert query
 
@MikaelEriksson But how do you insert, when T2 (D) is the PK?
 
@ypercube Oh, yes bad example. non clustered index T2.D should demonstrate the same just fine,
or clustered for that matter, just not unique
declare @T2 table
(
  D date index IX_D clustered
)
 
JNK
@swasheck oh does
INTO A HEAP
 
a heap's just a FIFO buffer, right?
this was an interesting read, but the conclusion was quite abrupt
 
4:11 PM
Can't read, that layout is too obnoxious
 
yeah. the layout was very obnoxious
 
JNK
"Aral" seems like one of those words that's just asking for a kerning joke
 
i'm not sure we let this one stand, folks
0
Q: Why disabling adding SQL Server user to "Perform volume maintenance tasks" improves database resizing so much?

Nikolay KostovIf I want to create 5GB database with CREATE DATABASE [test] CONTAINMENT = NONE ON PRIMARY ( NAME = N'test', FILENAME = N'E:\2012\test.mdf' , SIZE = 5529600KB , FILEGROWTH = 1024KB ) LOG ON ( NAME = N'test_log', FILENAME = N'E:\2012\test_log.ldf' , SIZE = 1024KB , FILEGROWTH = 10%) it ta...

 
@swasheck yeah, I've seen plenty of those annoying things lately
 
IMO, this is a terrible solution
0
A: SQL Server 2012 Pivot

jpwYou can not use dynamic sql in views or function. One possible solution could be to alter your query to drop/create a view and use it as a stored procedure that gets called by a trigger on insert/delete in the source table (so that the view is updated whenever rows are inserted or deleted). The ...

 
4:17 PM
@swasheck I think they're FINO in SQL Server (First In Never Out)
 
JNK
@JamesLupolt That's Mango DB
 
@JNK that's FI? ... "First In ? after that because we dont know if the write succeeded and besides, we're solving write speed problems, not read"
 
JNK
FINS - First In Not Sure
2
 
@JNK I don't know if the vertical alignment problems belong to kerning but the typeface looks ugly
 
@JNK i'll drink to that
 
4:23 PM
You also say "SELECT TOP 1000 * FROM table_with_1m_rows ORDER BY col1; ORDER BY will perform even worse, because it will have to first arrange all 1m rows in the table before it then returns 1000 rows. All of the above holds true whether the DB needs to use a sequential scan or an index scan.." Really? Will such a query always have to sort all the 1m rows of the table? — ypercube 2 mins ago
Please, someone tell me I'm crazy. I can't understand this guy's assertions in the question.
 
Ohhh lord. I need to quit drinking.
 
@Zane maybe you just need to drink better stuff
 
It was good stuff I just had to much of it.
 
what was it
@AaronBertrand would you take $25 + S&H?
 
4:39 PM
@PaulWhite The AFTER columns is 1000 characters. Perhaps should mention something about the limit of 900 bytes key lenght.
 
You're mistaking me for someone who cares enough.
3
 
Honestly I could barely be bothered to finish typing the answer.
 
@PaulWhite Was your comment flagged?
 
@ypercube No, I deleted it because it had served its purpose.
He edited most of the missing info into the question.
 
4:41 PM
ok. was worried after I read their rude comment.
 
Thank you for your concern then :)
 
I do not like replication
5
 
@swasheck Lot's of different beers.
 
sorry, I just had to get that out
 
@bluefeet What a scathing review.
 
4:45 PM
Are any of you using SQL Azure Databases at work (either prod or non-prod) yet?
Or Amazon RDS?
 
@JamesLupolt i've used them in the past ... we POCd the concept of them as an offsite DR node
 
@Zane I know right. I had to drop an article from a subscription but now I can't add the damn thing back in
 
@swasheck Was the POC successful?
 
@bluefeet "can't add ... back in" ... that's strikingly similar to "doesn't work"
@JamesLupolt depends on how you define success. yes. we set up a replica
 
@swasheck yup. When I try to add a single article to the subscription I get the very helpful message - Specify all articles when subscribing to a publication using concurrent snapshot processing.
gee thanks
 
I'm aware of that. However, when I ran it with all it generates a different issue with replication
 
have you tried the nuclear option? blow out everything and rebuild from scratch?
 
that's not a possibility
 
Also, consider MangoDB. It has 100% of the RDA for Replicantion
 
Sorry Paul, there is: IDX6 nonclustered located on PRIMARY TABLE, FIELD. Maybe this would change things you mentioned? — Atieh 1 min ago
 
4:52 PM
@billinkc no. mango is sharted
 
speechless
 
@PaulWhite a waste of a perfectly-good answer
 
Not frustrating at all. Not even a little bit.
 
Why is everyone on twitter talking about a dress?
Did I miss something.
 
@Zane yeah the white/golden - blue/black thing
 
4:57 PM
@swasheck totally
 
it's been all over, sigh
 
@Zane because they're stupid
 
@AaronBertrand Thanks for clearing that up.
 
Why does a highway back up when there's an accident on the other side of the f*ing median?
^^ happened to me this morning
@Zane people are arguing over the color of a dress in some picture, because the lightning made it look different. Because they have nothing more important to talk about.
 
@AaronBertrand what colors do you see?
 
5:00 PM
@bluefeet I plead the 5th
 
ha
 
@AaronBertrand it's not like it's some black magic like this:
 
I was told I was crazy this morning
 
Much more interesting than the dress.
 
@Lamak Why would you show me that in my current state.
 
5:02 PM
What sorcery is this?
 
You broke what little brain I had left.
 
@Zane yeah, as I said, black magic
 
I can't stop looking at it.
 
my god, it's full of stars
 
Flag it!
 
5:05 PM
hi
 
@bluefeet long story short ... replication doesnt even like itself. its own self-hate makes it an unusable product
low
 
hi guys i wanna ask, regardless of what DBMS you are using , if you have 30GB data and you have to fetch 13GB of it, how long you will take?
 
/facepalm
 
Depends.
 
/headdesk
 
5:06 PM
How many are you
 
uh , min/max ?
 
Can I use a trolley?
 
@PaulWhite adult diapers wont help this
 
looks like the party happened here 0_o
 
@MikaelEriksson they are legion
 
5:08 PM
@user965347 What do you mean by "fetch"? Depends on the speed of the server, network, and the ability of the receiver to process the data.
 
@swasheck And that is a quote from 1982 version of Ivanhoe.
 
oh, how long it will takes in average paul? will it take for 1 day?
 
@swasheck unfortunately, I'm stuck with it. I've got to figure out how to install/rollback these changes
 
fetch mean select query
 
@user965347 Totally depends on the factors I mentioned. If I were to read 13GB over a 9600 baud dial-up Internet connection, I might be dead before it completed.
 
5:10 PM
oh
 
@PaulWhite now just recursively post this
@bluefeet yeah. it's not fun. i had to wrestle Tx replication at my last place
@MikaelEriksson i'm an uncultured american ... but i repeat myself
 
@user965347 On the other hand, if I were using this network‌​, 13GB would take a small fraction of a second.
So, somewhere between zero seconds and the age of the universe.
 
lel
 
On average, half the age of the universe.
:)
 
@swasheck It's really weird what's happening. I dropped one table from a subscription but when I try to add it back it - it's trying to create a new subscription instead of using the existing one
 
5:12 PM
That's what you get for using replication.
Weirdnesses.
 
so replication will solve the problem somehow?
 
well, yes. But I've got no choice
 
@bluefeet yeah. you cant. you need to drop the subscription article and recreate the article
dur (for my typo)
 
that's just freaking stupid
why does it allow you to drop an article from a subscription but you can't add it back in?
 
This is stupid.
0
Q: SSIS 2014 issue with currency (Without Decimal) in a flat file source

user228777I am importing data from a flat file to Sql server database. In a flat file data comes without decimal like 3000 for 30.00. I tried setting up this column to DT_Decimal with DataScale 2 or DT_Numeric with precision (12 - 18) and DataScle 2 and I also tried DT_CY Currency. All these are inserting ...

 
5:16 PM
@bluefeet wait. so you actually dropped the article? sorry. i'm not very clear on the circumstance here
 
@Zane the key is "i dont know how to implement this"
 
How would it know to turn the 3000 into 30.00? Giving it a precision and scale will not change the value. — Zane 18 secs ago
 
@swasheck I have a publication with 2 subscribers. I dropped an article from one of the subscriptions. That worked. But now I can't add that single article back into the subscription it was dropped from
 
twitterverse is reporting that Leonard Nimoy has passed away
 
Terminate (with extreme prejudice):
-3
A: Restore failed for server (Microsoft.SqlServer.SmoExtended)

FU_AnswersMitch Wheat and ta.speot.is I hope you never ever need help in your lives! Your answers suck!

 
5:20 PM
@billinkc KKKKKKHHHHHHHHHHHHHHAAAAAAAAAAAAAAAAAAAAANNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNNN‌​N!!!!!!!!!!!!!!!!!!!!!!!!
 
@PaulWhite flagged for deletion and banning
 
Tempted to comment "your backup strategy sucks!"
But I'm an adult.
@billinkc Fascinating.
 
@billinkc you've now ruined my offensive flag
 
@PaulWhite Fortunately, I don't have the same responsibility
-9
A: Restore failed for server (Microsoft.SqlServer.SmoExtended)

FU_AnswersI didn't test my backups and now I'm polishing my resume

 
5:22 PM
Just saw that and LOL'd
 
@bluefeet Rollll it back
 
We must have three vote-to-delete capable people around, shirley?
 
If it receives enough offensive flags it will self destruct
 
Yeah. And it looks much nicer now anyway.
 
voted, flagged, gone.
 
5:26 PM
Deleted by me, @ypercube, and the magic -10.
 
uranus
 
Guy at work was listening to the radio in the bathroom. Who does that?
 
A humble confession. Cleaned off my old Mac Pro to prepare for sale. It has a 240 GB OWC SSD as a boot drive. Copied important content to a 240 GB OWC external SSD. Wiped the SATA drives those files came from and created a concatenated disk set. Opened disk utility. Wiped wrong 240 GB SSD. Lesson learned: disconnect the f*ing external SSD before wiping anything. Moron.
2
 
@Zane better than talking while crapping.
 
@Zane Do you know how many people I've seen talking while pissing?
I go out of my way to make lots of obvious bathroom noise.
 
5:29 PM
@AaronBertrand Ouch!
 
@PaulWhite the only truly important things were tax returns. Hopefully I don't get audited.
 
Alright I'm out. I've got to take a nap before going to winterfest.
 
Who's going to ask about backups first? Not me :)
 
@PaulWhite Hey come on, I had copies on two different physical drives inside the tower, then made a 3rd copy on the external SSD.
I out-moroned myself.
 
I know. I was being an a$$.
See voted, flagged, gone question above.
So is the Spock dead thing for real?
RIP Leonard Nimoy.
He should know, I guess.
 
5:34 PM
Seems so.
 
Sad.
 
Yeah. Big Bang Theory will likely have some kind of tribute.
 
Let's hope so!
 
5:47 PM
Read the tip, then read the comments. I don't understand where he got the impression that I was suggesting everyone have a free-for-all on creating extended events sessions.
(Or why he thinks I need to attend a lecture on Extended Events.)
 
He's clearly got a thing for Mindy
2
@AaronBertrand Obviously you don't understand XE well enough. I mean, look at the title of your article: Give anonymous users XE creation access in production
Although perhaps "Give SQL Server users read access to Extended Events" might help the SEO
 
6:23 PM
@AaronBertrand is that V1 of the article?
 
@swasheck mmm, maybe?
 
@AaronBertrand would that have been the same content upon which he commented?
or did you revise for clarity once he commented
 
I did not revise anything, that was v1. The only clarity I added was my response.
 
> Last Update: 2/26/2015
Bro, do you even timestamps?
 
@billinkc whatever
@billinkc no.
 
6:25 PM
I thought you were asking if either (a) I had more parts to write (e.g. a series) or (b) I have a lot of editing to do
 
@AaronBertrand i'm asking because i want to fight
 
Won't ship, though, sorry, ain't nobody got time for that
 
so you were lying about the $25 + S&H offer
 
yeppers
 
i'm probably not going to post this comment
> I fail to see the rationale behind the comment here. Nowhere in the article is it implied that users should be able to create XEs or be forced to plod through the XE metadata in order to enable users to do so.
> In fact, the author quite explicity states that he's moving toward a solution that would specifically address a scenario in which, "we may not want them to have all of those implied rights, and we may not even want them to see everything in a single extended events session. Let's say we want XEUser to only be able to see deadlock information, for example."
> Certainly the point is well-taken that a poorly-formed XE can "bring a server to its knees" but so can many things that occur within the day-to-day operations of a server. A few poorly-formed ad-hoc queries from a drag-and-drop reporting tool can also "bring a server to its knees" under the correct circumstances.
> Certainly we wouldn't be advocating that ad-hoc queries may only be executed by DBAs or Senior Database Developers, would we? Additionally, who's to say that DBAs or Senior Database Developers are immune from silly mistakes like filtering on the sql_text of an XE (especially in a 2008 XE)? Additionally, parsing XML is a CPU-intensive task in and of itself so why should anyone ever attempt to shred it in the first place?
> Or, we could simply let cooler heads prevail and read the actual content of an article and stop getting rankled about strawmen.
 
6:35 PM
Certainly
 
yeah
noticed that
also ... "additionally"
dickheads with an axe to grind or an agenda to promote piss me off
 
In my original draft of my comment, I asked if he had actually read the article, or just read the title.
Because the latter is the impression I still have.
 
yeah
oh well. it felt good to retaliate, if only in my head
the opening line in the Wired article on that dress thing
> Not since Monica Lewinsky was a White House intern has one blue dress been the source of so much consternation.
 
JNK
6:52 PM
Q for the room...
I haven't played with this much, but is there an option to replay transactions in profiler?
 
like replay a trace?
 
JNK
yeah
 
JNK
nice
 
but they all fall a bit short of workload simulation
 
JNK
6:54 PM
ok cool
 
it depends on what you're trying to do
 
and the reason a person would do such a thing was that they had recorded activity and wanted to evaluate whether change X helped/hindered?
 
RML utilities, Distributed Replay
 
JNK
we want to be able to simulate a workload
so like capture X minutes of actual activity and see how it works on different server setups etc
 
@JNK you'd have better luck with replaying a trace from a powershell script (because i know you like that sort of thing) that starts jobs
 
DRC is better than replaying a trace
 
@JNK you'll never be comparing 100% accurately to production. But you can compare the different impacts of the same replay and those should be pretty accurate relative to each other if you catch my drift.
 
JNK
yeah
run the replay to get a baseline time against our current setup
then get a delta on the new setu
 
exactly
 
yup
 
6:57 PM
and run them multiple times against each setup
 
JNK
ok great
 
so you can get some aggregates too
 
i should probably find something to eat. i sure am hungry
 
Gimme a rib
 
!!!!!
 
6:59 PM
Were you not going with a reference to "I'm gonna git you sucka?"
 
yes
 
Dat's what I said, booty twap
 
great. now i'm going to have to watch that with the kids (wife's in virginia)
 
There's a bit of swearing in it that I did not recall from my childhood
 
yeah
 
7:21 PM
@jnk ... you around?
nevermind
 
JNK
@swasheck sorry I am now
 
no worries.
had a powershell question.
got frustrated. gave up
 
JNK
oh noes
 
went manual
:)
 
7:48 PM
 
 
1 hour later…
9:09 PM
Having a case of the derps
We have code to approximately copy of one database over to another
This allows a team to load data into it so they don't bone the load into the app database (~1TB)
The initial creation was done by hand but I'm too lazy so I must automate
For an identity column, would you create it with same seed and increment as the source database and then change the actual seed value to match or would you just declare it as current seed
 
I would probably keep everything matchy-matchy and use SET IDENTITY_INSERT dbo.TableName ON;
 
IdentCurrent	IdentSeed	IdentIncr
1502234651	1500000000	1
@PaulWhite K, I figured I shouldn't be lazy but wanted to hear it from someone else
 
Your code worked the first time, without edit. I didn't know about ROW_NUMBER() OVER ... PARTITION, so that's a new trick for me. You're right, it seems relatively straightforward with that in hand. But, you also pointed me to some new tools, and to a book's worth of material to read about all the related issues. I don't think there's more that could be done with a single answer. A+++. Would ask again. — David Krider 2 mins ago
Ha ha ha. eBay'd.
 
Is there any activity in the US that doesn't result in masses of paperwork?
OMG OMG OMG
From the Acknowledgements in Itzik Ben-Gan's new book:
That's it then. I've officially peaked, and my work here is done.
12
 
9:48 PM
@PaulWhite wait ... i have a question for you!
 
Too late!
 
SUMBIT!
@PaulWhite sooooo i'm going to ask anyway because i'm a jerk like that.
still getting information
but we have an index where a simple ... alter index ix_testname on schema.table with (online=off); throws an error:
Msg 9108, Level 16, State 9, Line 16
This type of statistics is not supported to be incremental.
for the life of me i dont know why
it's partitioned
the stat was created as incremental
not filtered
 
@PaulWhite I look forward to you tearing into the internals of MySQL for your next adventure
 
@swasheck Is the index definitely partition-aligned with the base table?
@billinkc Farming for me I reckon.
 
If you raise any chickens, once they're done laying eggs, I'll be happy to KFC 'em
 
9:55 PM
Nice segue!
 
@PaulWhite duuuuuuuuuuuurrrrrrrrrrrrrrrrrrrrrrr nope. only index on the table in a separate filegroup. as an aside
nevermind
thanks @PaulWhite
 
Deleting all SQL Server knowledge in 3 ... 2 ... 1
 
Although for a presumably older and stringy bird, I'd go with a coq au vin approach over broasting
 
ROLLBACK WITH NOWAIT
 
This Query Store thing seems pretty cool
The next step toward the optimizer becoming self-aware
 
10:19 PM
What's an optimizer?
 
New fangled term for developer
 
Thanks!
 
@PaulWhite Yo. Beers sometime?
 
10:36 PM
@PaulWhite crap. i was wrong. frickin' ding dang frickin frackers
someone decided to move all of our indexes to a different file group.
so now none of the indexes are partition aligned
 

« first day (1515 days earlier)      last day (3336 days later) »