« first day (1395 days earlier)      last day (3471 days later) » 

12:18 AM
@Lamak The same guy has 39 (!!!!) gold badges from asking "Famous Questions" ...
 
TV, fire, beer. Place to myself :)
 
 
3 hours later…
3:23 AM
Apparently there's some sort of softball game on.
 
 
6 hours later…
9:36 AM
@Phil Very Olde Englishe.
Morning all
@swasheck TWEP
 
9:51 AM
Can someone please reject this proposed edit please? It breaks the link I added, and adds little value otherwise.
Oh, and good morning COTW
 
10:06 AM
@PaulWhite -ejected.
 
@Marian Chur.
 
 
2 hours later…
11:54 AM
@PaulWhite may I pick your brain, please?
related to this comment of mine:
With all due respect, I don't think @James's answer is a solution here (the article yes, it's brilliant, the proposed solution I don't think so because it's not feasible to do computed columns every time estimate/actuals don't match). And also it doesn't match what your own fix was. By seeing the execution plan we could've seen that your query doesn't use the composite index but probably does a table scan with implicit conversion on that condition (just a guess now). — Marian 44 secs ago
 
JNK
12:11 PM
hi all
 
hi you
 
@Marian I agree. The article's case is similar but not exactly the same as the question.
@Marian And the OP's comment above (" When I added single quotes around the numbers in the IN clause the cardinality problem went away.") suggests it's an implicit conversion issue.
 
JNK
@SimonRigharts No idea, they told me Xero was looking for a DBA in NYC
"Jason, these companies are looking for candidates like you..." etc etc
Relevant to my Qs yesterday about licensing
Please help me settle a disagreement: Could one still purchase SQL Server 2008r2 Enterprise if needed? #sqlhelp
The DBA™ is still insisting you can't get it and using the automated quote system on MS website as "proof"
This system also does not list any SQL Server version besides 2014 and no windows besides 8.1
 
JNK
mahvelous
 
Huh, I don't see enterprise edition for any version though.
 
JNK
me either
but I'm sure they sell it
Just probably for a quote
not in a box
 
Agreed. Might be something to do with ENTERPRISE feature though and them wanting to sell you additional things if you're dropping that kind of cash
 
JNK
yeah who knows
point is its doable
Brent also confirms which is good if I need a citable opinion
(no offense Bill!)
 
12:44 PM
(domain of crap I know about)(everything else, licensing included)
 
JNK
:)
 
@JNK Heh, my email earlier this week said "Bill, (former employer) is looking for people like you" November Sierra...
 
JNK
lol
Mine are all in downtown manhattan which is just a tease for me
 
Being ignorant of the area, why so? Just the commute?
 
JNK
yeah
Right now I work about 45 minutes north of manhattan
And I'm another 40 miles from the city than that
so if I worked "regular" hours in downtown it would probably be like 2-3 hours each way
I imagine closer to 3
It's like 40 minutes just to the train station from my house
 
12:55 PM
Huh, in my mental map, I thought CT was south of NY
This is clearly wrong
 
@JNK i'm in jersey. let's meet up
 
Oh, I want to live in Valhalla. That'd be awesome, except for the whole I don't want to move
 
JNK
@Kermit Would if I could!
How long are you in NJ?
 
@JNK i leave in 31 hours
 
JNK
ugh sorry
I am stuck at home today/tonight
wife teaches a class
 
12:57 PM
@JNK i wanted to do that
 
JNK
I don't know if you want to do THIS class
It's a fantasy writing class for 10-12 year olds at our library
@billinkc yeah it's northeast
 
I spent 3 semesters teaching a C++ class at the local community college. It was interesting. I think that'd be what I'd like to do whenever I start winding down (and no longer need money because there ain't diddly there)
 
JNK
@billinkc it does seem like it would be rewarding(ish)
Wife taught writing at a CC for a bit too
 
Some of the students were awesome. One was a non-traditional that ... man, he must have done a lot of drugs
I let them do a paper as extra credit and he turned in this crazy hippie manifesto talking about how all things are connected in the universe and love and such
 
@billinkc i would have failed him. did he show what he tried?
 
1:02 PM
This was long before WHYT
 
@ypercube thanks for clarifying that. Same was my thought, but didn't articulate so well.
@JNK asked our licensing expert (@Mark) and it seems that your friend is right, now you can only buy the current version (2014) with permissions to downgrade one back version. That's kind of it, sorry.
 
@Marian Thnx. The OP commented:
Hi All, Just to clarify why I accepted James answer. It got me looking into multiple predicate issues. So I tested using single predicates and noticed that integers were being stored as varchar for the RateItemType field. When you hover over the accept tick you see the following tooltip: "Click to accept this answer because it solved your problem or was the most helpful in finding your solution". This was the most helpful answer in solving my problem. — Alan T 24 mins ago
 
Ohhh friends. JNK and The DBA TM sitting in a tree...
5
 
@AlanT fair enough. The problem with this is that future readers may not read the comments but in a similar problem, read the accepted answer that says "your problem is the fact your WHERE clause has multiple predicates on the same table" and get confused because that is not the main issue. And neither was a computed column how you solved it. — ypercube 1 min ago
 
JNK
@Marian wth
My understanding is you can get it just not through MS
 
1:18 PM
microsoft.com/licensing/default.aspx everything you never wanted to know about licensing
 
@JNK Oh, sorry. We always used official channels. BrentO might be alright, have no idea, probably he did it already.
 
But find out who does the actual purchasing there, I suspect you're a SMB so you'll have a reseller attached to your account and they'll know this stuff off the top of their head
 
JNK
Well it sounds like there's and official MS path
that's v. limited
and an aftermarket path
@billinkc AHHHHHHHHH cooties!
 
First comes a bat, then comes the nurse, then comes JNK driving the hearse
 
JNK
lol
You should write children's books
 
1:22 PM
I should. My meter is outstanding
'specially since my rap career is going nowhere
 
Is there utility in the newly added tags the editor added to this question?
1
Q: Filter table before join

James AndersonI have a stored procedure that populates the temp table #employee_benefits with a list of Ids. This table ends up being roughly 10,000 rows long. The query below then selects from a table called EmployeeBenefitData that has around 4 million rows. SELECT ebd.EmployeeBenefitDataId, ebd.EmployeeB...

 
no
 
I was going to delete them from the question
@billinkc not that I don't agree, Bill, but does anyone else have an opinion?
 
I speak for the collective
 
:-)
 
1:30 PM
Now go sit in timeout
 
hmmmm seems he wasn't actually editing the question to add those tags; he added them to his own question.
I still think they stink
 
What value would index-seek have? Oh crap, I have an index-scan and all of these questions say it's bad, I need to mangle this plan for seeks. Meanwhile, their performance goes to shite because they did something dumb but they got their seeks
 
yup; and the old test of could stand by itself to describe the question? I think not.
 
@MaxVernon do we really need those tags? in general I mean..
 
JNK
I don't see any use in them
 
1:35 PM
me neither
you could start a vote, but I'd guess the output
 
@billinkc Ah, percussive stakeholder management. Warms the cockles of my heart.
 
@ConcernedOfTunbridgeWells Your heart is black as coal and icy as the depths of space and you know it
 
@billinkc Which is why it needs warming.
 
All right, Bad habits : Counting rows the hard way
 
2:02 PM
I can reproduce your error, if I have Excel open — billinkc 8 secs ago
 
JNK
2:12 PM
@AaronBertrand Typo alert:
> however this function can have a performance impact, can still block, and may be even more expensive than a SEELCT COUNT(*)
 
Yeah, why'd you misspell performant like that?
4
/me ducks
 
@JNK danke
 
JNK
@AaronBertrand no prob bob
 
(When I proofread I tend to skip past anything formatted as code.)
I also ignore spelling/grammar hints from the editor
 
JNK
Me too
 
2:52 PM
So in the celebration for the giants winning their 3rd World Series in 5 years 2 people were shot and 1 stabbed....
 
JNK
WOOOOOOOOOOO
 
@Zane doesn't that happen at all celebrations?
 
Most of the parties I got to don't have that happen.
 
@Zane i like the giants, a lot. i can't stand their fans.
frickin' toolbags
 
@swasheck Tell me about it. I just moved to SF a couple of months ago and those jerks are EVERYWHERE.
 
2:55 PM
@rm-rf sounds like you can tell me more about it than i can tell you ;)
also - i'd really like to learn how to play banjo
 
@swasheck I live a couple of blocks from the park. I didn't know what I was getting into...
 
@swasheck In baseball I just root for the home team. I don't really have very much invested into it.
 
@Zane i have a hierarchy
i actually dont like to watch baseball unless i'm at the park.
 
JNK
@rm-rf YIKES
 
@swasheck I root for the Twins and I would also like for the cubs to do well just because they've had it rough for too long.
 
2:58 PM
@rm-rf never been to sf. is it a nice area? in denver, our ballpark area is a case study in gentrification. went from a seedy area to where all of the yuppie kids move ;)
 
@Zane the Cubs did that to themselves by shooing that goat away back in the 1910s
 
@Zane i have no pity for the cubs.
 
Sorry it was in 1945
The Curse of the Billy Goat is a sports-related curse that was supposedly placed on the Chicago Cubs in 1945 when Billy Goat Tavern owner Billy Sianis was asked to leave a World Series game against the Detroit Tigers at the Cubs' home ballpark of Wrigley Field because his pet goat's odor was bothering other fans. He was outraged and declared, "Them Cubs, they ain't gonna win no more," which has been interpreted to mean that there would never be another World Series game won at Wrigley Field. The Cubs have not won a National League pennant since this incident and have not won a World Series since...
 
Gå inte över ån efter vatten.
Your code does not make much sense at all. Build a comma separated value that you transform to XML that shred to rows. Why not just get the rows in the first place? — Mikael Eriksson 7 mins ago
 
@Zane then you're going to the wrong parties
 
2:59 PM
@AaronBertrand I thought they just asked the goat to leave.
 
@AaronBertrand in the grand scheme of things and in the broader timeline, 35-ish years is just a rounding error
 
@swasheck got my curses mixed up
 
well tomorrow is halloween. you really need to get that squared away
 
I'm sure I'm doing something totally stupid, but how do I get bcp to connect using TCP instead of trying to use named pipes? I'm connecting to an instance, so I'm using -SSERVER\INSTANCE
 
-SServer,portno or -SServer;portno?
 
3:02 PM
@MaxVernon be lazy. use SSIS.
 
I'll try the semi-colon. Already tried -SSERVER,port and -STCP:0.0.0.0,port
 
@MaxVernon I find Sybase's bcp documentation is way better than Microsoft's and the utilities still behave very similarly.
 
Thanks COTW. I'll look at that.
 
@MaxVernon I think you use a : (colon). Also, I think you need to put it in quotes, but I could be wrong
-S"SERVER\INSTANCE:1433"
 
3:09 PM
If you specify the port you shouldn't also have to specify the instance name. It gets tricky though if dynamic ports are used...
 
YEah, so intead -S"SERVER:1433". I think.
 
the instance has an assigned port; I've tried just about every single combination names I can think of
netstat -b shows SSMS is connected to the instance on SERVER:port, so I know I have the server and port name correct. Stumped.
going for coffee. maybe it'll work after that.
 
3:30 PM
interestingly sqlcmd -SSERVER\INSTANCE does connect immediately
 
@MaxVernon If it is on the same server that is probably using shared memory. If it is a different server it is probably using named pipes. Why are you so bent on forcing BCP to use TCP/IP when other methods will probably work?
@MaxVernon PS I got this to work no problem: -S"SHELDON,56737" - I validated the port number in SQL Server Configuration Manager, not using netstat.
 
I wonder if the port number that netstat shows is the one that it delegated the connection to but the real one is whatever config manager shows
 
yeah. i'd check through configuration manager
 
Ancient unix information port thread stuff is on cold storage
 
Why do people change their port for SQL Server?
 
3:37 PM
named instances
"security"
 
to annoy @MaxVernon
 
@Zane If you have more than one instance of SQL Server, they can't all use the same port.
 
@AaronBertrand But what if I have two instances using the same mdf? :P
 
And yes, some people even move a default instance away from 1433, because they think 1433 is more vulnerable than any other port. A port scanner doesn't give a crap what number is used...
Oh my, please build a calendar table. — Aaron Bertrand 2 mins ago
I really should do an updated "50 uses for a calendar table" post
 
@AaronBertrand I read fnGetNthWeekdayOfMonth as FUCKING GET THE WEEKDAY OF MONTH
 
3:54 PM
Seems appropriate
 
GET THE NTH WEEKDAY OF MONTH
 
hey does anyone math in here
if someone says there's a 4:1 compression ratio .. what's that in decimal
 
7
no 5
 
thanks
 
4:00 PM
42
 
time to send this to the client
ah shit just lost my job
 
π
 
Just send them a copy of Donald Duck in Mathmagicland.
 
@Kermit check under the seat cushions
that's where i find many of my lost things
 
4:04 PM
  i * pi
e
 
-1
 
Don't be so negative @Lamak
<----- feels shame.
 
lol
 
@Zane it's not a feeling. that's just shameful
 
4:27 PM
i just took the biggest dump of the week
 
lol, somebody has autoshrink ON
0
Q: Can I turn auto-shrink off while on production server with people connected?

ianI'm going to turn auto-shrink off on our SQL Server 2008, but I was wondering if I need to wait until the end of the day when no one is on the server? Or, can I just make the change now? Thanks!

 
@Kermit thanks for sharing
 
swasheck has an imaginary component, which makes him complex.
This also means he's allowed to eat quiche.
Real Men Don't Eat Quiche, by American Bruce Feirstein, is a bestselling tongue-in-cheek book satirizing stereotypes of masculinity, published in 1982 (ISBN 0-671-44831-5). It popularized the term quiche-eater, referring to a man who is a dilettante, a trend-chaser, an over-anxious conformist to fashionable forms of 'lifestyle', and socially correct behaviors and opinions, one who eschews (or merely lacks) the traditional masculine virtue of tough self-assurance. A 'traditional' male might enjoy the ironically not so exotic egg-and-bacon pie if his wife served it to him; a quiche-eater, or Sensitive...
 
i'm actually pretty vapid and shallow
 
4:37 PM
 
@Kermit Can't watch. What's the gist?
 
@Zane christie being a fat prick
 
@AaronBertrand I got the port number from configuration manager, and I've tried connecting both from my workstation, and from the server itself. No go either way. As I said, I can get sqlcmd to connect using just the SERVER\INSTANCE name. So weird.
 
firewall etc., don't know, sorry. Worked fine for me on first try.
 
@billinkc That's the case here. SecThruObf.
@AaronBertrand I'm not saying bcp can't use named pipes. Named Pipes is disabled in SQL Server Configuration Manager for the server in question. TCP/IP is enabled.
 
4:48 PM
@MaxVernon so you're tilting at windmills, then?
 
@MaxVernon I disabled both named pipes and shared memory, restarted the service, and still it worked fine:
The named instance is SHELDON\SQL2014. Here is where I got the port #:
(and yes, I know I am overdue some instance cleanup on this machine - clearly an experimental VM)
 
OK, brain aneurism. I can do this in PowerShell easy-peasy but C# not so much. I need to pull a list of just user databases using SMO in C#. Have this so far:
var sourceSrv = new Server(sourceServer);
var importDBList = sourceSrv.Databases;

I just can't seem to figure out how to filter out the system databases or is there another way of doing this stuff?
 
Hmm, too bad you can't just add a where clause there, like you could in T-SQL
 
I know right!
 
I like SMO only a little bit more than DMO. I hate DMO.
 
5:02 PM
I thought C# would have some filter method that passes in strings but can't find it
 
Can't you tell it to run a query instead? #RightToolForTheJob
 
Yeah, just trying to keep it to smallest number of lines I can
 
Like calling a stored procedure?
(Guess that makes sense if it's targeting a limited number of instances.)
 
Guess query is going to be cleanest way of doing it
 
5:22 PM
0
Q: One-way sync between MySQL and SQL Server

TinoI have a table A on MySQL and a table B on SQL Server. Now, I need to keep B in sync with A (one-way), but B should "always" remain accessible for querying (now, one second of downtime won't hurt anyone...). The sync should occur once every hour. Some scenarios come to mind: Check A for updat...

What an odd set-up
Anybody know of any good research on how BULK insert works from a Storage internals perspective?
 
JNK
@Zane what do you need to know?
 
hi all
does executing jdbc.queryforlist in oracle database consumes cpu while its returning the result?
 
@JNK any and everything. Does it change how a row is entered into a page vs a standard insert?
 
@AaronBertrand sort of similar to your first revision request -- meta.stackoverflow.com/questions/275705/…
 
I know it locks at a page level.
 
5:32 PM
*cpu of the host not the database
 
@harish.venkat methinks you'd find a better answer over in stackoverflow-land
 
ok thanks
 
@JNK Thanks. I'm going to dig into that now.
 
JNK
I used it a lot for bulk loading at my last job
very interesting
 
5:47 PM
@AaronBertrand thanks very much for confirming that it works. Perhaps I'm doing something wrong with the command-line: bcp dbo.TableName out -SSERVER\INSTANCE -T -ddatabasename -oC:\TEMP\output.bcp
 
@billinkc I have a question.
 
@max -S"SERVER\INSTANCE" but also try -S"SERVER,port"
If the browser is not running and/or named pipes is disabled, I'm not sure SERVER\INSTANCE can work.
I wish people would stop blindly upvoting crap they can't possible have even looked at
1
A: How to use variables with RESTORE FILELISTONLY

James AndersonI think you can only do this with dynamic SQL. Replace the body of your SP with the following: DECLARE @BACKUP_PATH as nvarchar(max) = 'Z:\BACKUPS\my_database_backup.bak' IF object_id('sp_restore') IS NOT NULL drop procedure sp_restore go CREATE PROCEDURE sp_restore AS BEGIN DECLARE...

 
6:03 PM
Scratch that @billinkc I've thought of a much cleaner way to handle this issue.
 
@AaronBertrand this is SO DUMB. It seems bcp is, shall we say, anal, about the command-line. I had to use: bcp dbname.schema.tablename out c:\path\to\output.bcp -SSERVER\INSTANCE -T -n seems using the -o option to specify the output path is a no-no.
 
@Zane not asking @billinkc does seems cleaner
 
thanks very much for your help!
and sorry for wasting your time, everyone
 
ehrmagerd @MaxVernon
 
@MaxVernon but that shouldn't lead to a "con't connect" type error
 
6:05 PM
@AaronBertrand that's what one would expect.
 
@MaxVernon so with -o what exact error were you getting?
 
seems there are more than a few connect items for bcp: duckduckgo.com/?q=site%3Aconnect.microsoft.com+bcp
`SQLState = 08001, NativeError = 2
Error = [Microsoft][SQL Server Native Client 11.0]Named Pipes Provider: Could not open a connection to SQL Server [2].
SQLState = 08001, NativeError = 2
Error = [Microsoft][SQL Server Native Client 11.0]A network-related or instance-specific error has occurred while establishing a con
nection to SQL Server. Server is not found or not accessible. Check if instance name is correct and if SQL Server is configured to a
llow remote connections. For more information see SQL Server Books Online.
@AaronBertrand not much in there about the output file.
 
That is bizarre. I very rarely use bcp, but when I do, I use queryout.
 
of course, the "For more information see SQL Server Books Online" bit was gratuitously helpful. Not!
 
(Never out or -o)
 
6:14 PM
@Kermit 4:1 is 4.0 in decimal ;)
 
@AaronBertrand hmmm. This is my first time.
 
@ypercube actually, i did the math. it's 0.25
 
Well, yes, the inverse of 4 is 1/4
 
Ugh, another "gee I should have used a calendar table" monstrosity
0
Q: TSQL Calendar - Fiscal Week; WeekdayOfMonth; NormalizedDayNumber

k_j_s_brdsRblueI am in the process of creating a stored procedure that creates a calendar table output that provides fields related to calendar day, fiscal date, and normalized date (I will explain normalized date in more detail shortly). I have excluded a number of fields that I have already created successfu...

 
JNK
user image
2
 
6:19 PM
@JNK nice one!
 
Holy cow did I ever overcomplicate that problem.
Ha ha, Aaron, I know this is unusual. We definitely a calendar table already. The idea is to have a stored procedure that we can hand off to any of our clients to implement quickly that will give us some customized date fields for reporting purposes. — k_j_s_brdsRblue 6 mins ago
 
6:38 PM
let's take something that's complicated and further complicate it
 
We are not mind readers
As I said, it sounds like you need another table for this. But how can I know?, the database design is heavily dependent on the requirements and I don't understand them clearly — Lamak 24 secs ago
@swasheck jeez
 
6:54 PM
@swasheck Getting more and more impressed with Pure.
 
Does anybody have a linked server that is valid but offline?
 
@James i know i am
@AaronBertrand nope, sorry
 
Doesn't have to already be offline. You could trip on a network cable or something.
 
only if sqlsentry wants to pay me my salary going forward
 
Well I'm happy to take the heat, but not the bill
Never mind I can set this up myself. Me so stupid sometimes.
 
6:57 PM
@AaronBertrand or plug the backup power strip into itself and cut the main power
 
that'd never happen
 
@swasheck never
 
@swasheck They've been really easy to work with. They fixed the bugs we reported over a weekend and were happy to put us on a call with a software engineer (not sales or tech support) to discuss some questions about their de-duplication and compression internals.
 
@James yeah. they've always be very accessible for me
 
@swasheck Do they say 'open kimono' a lot when you talk to them?
 
7:12 PM
hahah. no.
 
@swasheck I've heard three different people from Pure say it now, one repeatedly!
It's a bit disturbing.
 
7:37 PM
@JNK Oh you mean the company's still looking - yeah probably. (I thought you meant it said I was looking for a job, hence my reaction.)
 
JNK
@SimonRigharts Yep I understood that from the response
Sorry it was the corporate "you" :)
 
@JNK "We are Xero, you will be assimilated"?
 
JNK
Not necessarily
 
if xero would buy me out of my retirement here, i'd leave in a heartbeat
too many poo-flinging apes here for my taste
 
how many poo-flinging apes would be ok?
 
7:45 PM
@Lamak 42
 
@Lamak 1
 
@swasheck does that happen?
 
@swasheck so, only you? ;-)
@bluefeet :-)
 
@Lamak exactly
@Zane only when you're a LOT better at your job than i am
it can happen for @AaronBertrand ... not for @swasheck
 
I didn't even know that was a thing that could happen.
 
7:47 PM
Hola
 
Yo.
 
oh yeah ... "i will lose x dollars from my retirement, counting bonus and profit sharing if i leave here now. i would be willing to leave that for n"
 
@swasheck Yeah, i negotiated a signing bonus at my previous job because i was going to lose out on some vesting in my 401k match and would have to pay back a couple grand that former company had reimbursed me for grad school
I wasn't making enough that it really mattered, so everyone was cool
 
yeah. i'm not even saying all of it ... i'd take 80% of what i'd lose :)
 
@swasheck I don't understand your retirement system
 
JNK
7:59 PM
you could do two operations
right?
 
so i ultimately dateadd(second, (-1*bignumber)/1000, sysdatetime())
which is why i deleted my comment
it's lossy
but oh well
 
JNK
DECLARE @interval bigint = -3089991531
DECLARE @secs int
DECLARE @ms int

SELECT @secs = @interval/1000
SELECT @ms = @interval%1000



SELECT DATEADD(Second, -@secs, (DATEADD(MILLISECOND, -@ms, SYSDATETIME())))
the calcdate is unneccessary
 
hrm. interesting.
 
JNK
then you keep the sub-second stuff
and the -s are unneeded too
minuses
Modulo is a very handy operator
 
I think we are finally going to hire a DBA/database architect to wrangle in our developer's horrible DB designs. This will be nice. I've been helping review OLTP database designs since the application developer manager who was actually good with databases left the company.
If the BI consultant can spot how awful your OLTP design is, you have problems :-)
 
8:18 PM
haha
i need a hobby.
 
Why?
 
because i've lost interest in all of my other hobbies
maybe i will try to learn the banjo
i just need ... a banjo
wow. they're expensive
 
8:33 PM
Maybe you could try singing? That's cheap.
 
Origami?
 
9:00 PM
@MikeFal you dont want to hear that
 
9:18 PM
@bluefeet ugh. nincompoop.
i love the skeptics site
28
Q: Is there a cure for Ebola?

accurate opinionWikipedia's page on "Ebola Virus Disease" states: No specific treatment for the virus is available. Wikipedia's page on "Ebola Virus" also states: There is no cure for Ebola, but if people get care quickly from doctors and nurses at a hospital, more of them live. So how are there ne...

 
 
1 hour later…
10:46 PM
@Marian Sorry I went to sleep. Is the question still relevant?
 

« first day (1395 days earlier)      last day (3471 days later) »