« first day (783 days earlier)      last day (4382 days later) » 
00:00 - 20:0020:00 - 00:00

00:00
@ConcernedOfTunbridgeWells The question is where you will be working on Friday.
@ConcernedOfTunbridgeWells I'm in. Have already responded to the invite that I didn't get :)
@ConcernedOfTunbridgeWells But yes, I'll probably try walk to the door with @JackDouglas and his card :)
00:21
@ConcernedOfTunbridgeWells Yep
 
9 hours later…
09:19
@ConcernedOfTunbridgeWells din't you think your Distributed Database Systems 101 should be replicated as a DBA blog post?
4
09:52
crosspost alert
0
Q: Excluding duplicate fields in a join

StevenI have a dataset I'm doing analysis on. It turns out it can easily be enriched with demographic and community data which vastly improves the analytical results. In order to do this I'm joining in demographic and community data before doing analysis. I need to exclude some fields from my core sam...

10:14
3
Q: Why did PostgreSQL choose an elephant as it's logo?

gaRexWhy did PostgreSQL choose an elephant as it's logo? It wasn't clear from logo wiki. UPDATE: Now wiki updated :) Thanks!

@dezso Maybe, or maybe linked out to in an article about NoSQL fanboi-ism.
11:02
@PaulWhite A theory on why the asterisk is used in the comments section (stackoverflow.com/questions/9124055/…)
11:32
9
A: Is SQL Server 2012 Management Studio "Express" any different?

Aaron BertrandIn the RTM release of SQL Server 2012 (and in previous versions), yes, they are quite different. The Express version was missing a bunch of functionality, most notably the ability to manage SQL Server Agent (even on non-Express instances). There are other things missing like Profiler but technica...

@Aaron does this mean that you can get profiler with Express now or am I reading that wrong?
11:44
Oops.
0
Q: How to undo TRUNCATE command

David SmithersI accidently executed TRUNCATE command on a wrong table and all my data is gone. We do have a backup but its 2 weeks old and doesn’t have all the latest data. Any ideas how can we rollback this command and get the data back if possible? Are there any third party tools that can do this?

@JackDouglas You could read it either way. I suspect not, since Profiler isn't part of SSMS, but once Aaron has tested it, we'll know :)
11:59
@MikaelEriksson No idea why but it is in the documentation: msdn: CAST and CONVERT (under "Truncating and Rounding Results")
Good for migration here?
0
Q: How the internal organization of NON clustered index with two columns different from NON clustered index with one column in SQL SERVER 2008

mohangWe are trying to understand for academic purpose how a non clustered index with two columns organized internally inside SQL server 2008 as compared to non clustered index with one column. We tried Google, but did not get any convincing answers.

Yuck
@MikaelEriksson Seems likely, yes, thanks for the link
@ypercube I think it is still there for backwards compatibility reasons and the "who to blame" could be Ashton-Tate (DBase) which was involved in the early SQL Server days. DBase/FoxPro also uses * for integer overflows with the fine difference that it also stored the * in a integer column if a overflow occurred.
13:04
Am I mean here (TM)?
So why is it that slow at OP's? — dezso 16 secs ago
13:47
@PaulWhite do you mean it hasn't been released yet?
@JackDouglas No I just mean I haven't tried it yet.
14:26
@JackDouglas Fancy popping along to the SE shindig on Thurs?
@ConcernedOfTunbridgeWells I've signed up but I don't know if they will let me in as I wasn't invited like you :)
@JackDouglas I think it would be exceedingly churlish of them to bounce you unless they're really standing room only. Maybe you could ask Bethany Mazewski and see how many RSVPs they've got. Given that you're a mod on DBA.SE I think you've got as much right to be there as anyone.
offtopic?
JNK
JNK
@JackDouglas It's extremely unlikely they will boot you since you're the only nice Mod on DBA
0
Q: Duplicate entry '0' for key 'UQ_CallsIDCC'

user20540I have my own Server with Voice Switch and not really familiar with SQL. Having problem with following: 02-25 12:05:32 MySQL error description : Duplicate entry '0' for key 'UQ_CallsIDCC' 02-25 12:05:32 MySQL sql state : Duplicate entry '0' for key 'UQ_CallsIDCC' (this error gives from switch co...

(and careless OP removed my formatting)
@JNK nice = Brit?
14:38
@JNK ha ha :)
@ConcernedOfTunbridgeWells I guess it depends whether the SO hoards have seen the link posted somewhere...
@JackDouglas Besides which, Mark and I are going for drinkies afterwards.
but I have a fall-back plan to go to the pub instead :)
Or pretend I am you
@JackDouglas Sounds like a jolly fine idea.
what's up with sqlfiddle today?
@bluefeet nothing, apparently
14:44
I can't get the main page up
I've Skype'd Jake to let him know...
@JackDouglas thanks
@bluefeet He's on the case :)
I'm hoping it isn't my fault this time...
I think that he wants to start charging for this ;-)
@JackDouglas this time? You broke it before
14:46
This is @JackDouglas contacting sqlfiddle youtube.com/watch?v=qtK0KMH-8xs ;)
@billinkc blocked
It's the scene from Tommy Boy when David Spade opens the broken car door "What'd you do?"
@bluefeet yes, I host some of the databases (mostly the pg and older MySQL ones) and the other day I changed my firewall settings... you can probably guess the rest
@billinkc :)
@JackDouglas nice.
@JackDouglas How's the FusionIO disk going?
14:49
Which sadly I witnessed first hand. Not bending a door off against a concrete pillar but a college roommate opened the door and the pin holding the door together sheared off. Perfect moment of silence followed 5 us in unison "What'd you do?"
> back now
@Lamak ^^^^^
@JackDouglas hooray
@ConcernedOfTunbridgeWells Unfortunately it isn't: I can't use it for what I was hoping to use it for... I might think of something else, but if you'd like it back please shout :(
@JackDouglas Why didn't it work?
@ConcernedOfTunbridgeWells I didn't want to install any drivers on my vanilla RHEL (yes you might laugh at that)
14:54
Sigh, system administration is a pain in the ass
Hi Jake!
Hi Jack. Thanks everyone for letting me know about the outage. Normally I have a script running every few minutes to check if everything is running smoothly. This has kept the site going strong for a long time, and would have still if I hadn't disabled it "temporarily" while doing some other work.....
@JakeFeasel thanks for the quick fix of it
@JackDouglas Maybe you can regression test it on another machine before you deploy it to prod.
@bluefeet Hopefully it wasn't down too long
14:59
I am not sure how long it was down.
@JackDouglas I don't have any immediate need for it. I've got a 640GB one in my dev box and I don't have anything with full-height PCI-e slots to put it in.
@ConcernedOfTunbridgeWells it's a half-height card, isn't it?
@JackDouglas I've only got the one half-height bracket and that's on the other card.
@JakeFeasel Any plans on adding more DBMS ?
Maybe I can sweet talk FusionIO into giving me another half-height bracket ;-}
I managed to get a complete set of current F/C disk firmware out of NetApp by batting my eyelashes once.
15:02
@ypercube Yes, actually I just talked to Jack about this....
I could use help from you guys
@JakeFeasel Do you need a machine to run them on?
Basically, the reason sqlfiddle has the databases it has is because they are the ones I have personal experience with
I don't really have the time to adequately ramp up on another database right now
DB/2 for instance
However, Jack has (at least one) little VM available for another server I believe
All I really need is a DB server to connect to and a template for setting up (and tearing down) a new space for users to create their objects
@JakeFeasel How much capacity do you actually need?
@ConcernedOfTunbridgeWells there was one in the box iirc?
(Most of my templates involve creating a user, creating a database, setting permissions, etc...)
I don't need much
15:06
@JackDouglas Yes, but the 640GB one didn't have a spare bracket with it, so I used the half-height bracket that came with the 80.
Hosting fiddles usually takes very little db resources
@JakeFeasel So a secondhand 1U box with a couple of SSDs and enough RAM would support your whole portfolio?
Yes probably
I am using (aside from Jack's servers) 3 "small" EC2 instances for hosting the whole app
one windows and two centos
@JakeFeasel I could get something like that off ebay for about 3/4 of buggerall if you've got somewhere you could host it.
Therein lies the problem
15:08
@JackDouglas Where is your machine physically located - have you got it in a colo facility?
@ConcernedOfTunbridgeWells yes
in Maidenhead
To be honest though, right now capacity is less of a concern
For adding new db types
@JackDouglas How much would they charge for a 1U or 2U machine?
@ConcernedOfTunbridgeWells 1U is about £60pm but we already have spare capacity, just not spare DB/2 experts :)
@JackDouglas So hardware isn't a problem then?
15:11
@JakeFeasel is the windows machine just for hosting the MS SQL and Oracle instances or is it the app server too?
@ConcernedOfTunbridgeWells no not really.
Just SQL Server and Oracle
I'd be curious as to how my DB2 experience compares to others. We run it on zOS here. Seems such a hackneyed thing to use from an SSIS perspective as the environment name is part of the table name (DEV.Licensing vs PROD.Licensing) Oh well, time for scrum
I don't know if we have any DB/2 wonks on the books here, but @CadeRoux works with Teradata quite a bit and you can get VM images of their express edition. Not sure what the licensing allows you to do, though.
Yes I believe their Express-C version would be suitable
Mayge you could talk to @CadeRoux and see what he has to say.
15:15
I could email him and see
@billinkc Do you think you would be up to configuring a VM with DB2 UDB (whatever their express version is) for SQLFiddle?
Well I've got to get ready for work, I'll check back later. If you all want to work with Jack on whatever else you'd like to see up there, that would be great. Thanks everyone!
I don't think I have any specific expertise in anything you don't already have, but maybe some of the folks here do.
@JakeFeasel Would you need a new server for adding more MySQL variants (like MariaDB)?
@ypercube I think that is already on the cards
15:22
@JackDouglas is it really? That would be nice.
What would be really nice is if someone would sponsor us with some of these :)
@JackDouglas Not an S3700?
15:38
@ConcernedOfTunbridgeWells those are 100 times better actually
and cheap at twice the price
@JackDouglas How much space do you need?
@ConcernedOfTunbridgeWells Willing to give it a shot. Never admin'ed an installation. They keep a tight hand on the reigns for permissions
@billinkc Talk to @JakeFeasel about it if you're up for it.
@billinkc I can set you up with a VM, and you'll need to liaise with Jake about the rest: basically he needs a way of isolating the SQLFiddle run for other runs eg by wrapping the whole lot in a transaction/schema/database/whatever
Let me do some digging this evening (-6 gmt), see what I can learn about manning a DB2 instance
15:49
@JackDouglas I presume that the SSDs would run in your machine without needing additional drivers ;-}
@JackDouglas Might be able to help out there. How much do you need and what's the advertising real estate? :)
@MarkStorey-Smith good questions, lets chat on Thursday. cc @JakeFeasel
@MarkStorey-Smith Nothing like a spot of corporate sponsorship :)
@billinkc do you know if it's possible to hold an open connection among many SSIS packages instead of sending a log in request each time.
JNK
JNK
@Zane I just wrote a PS script to do that :)
15:58
@Zane It should be using connection pooling but to force single retained connection across the package, under your connection manager there should be a property RetainSameConnection or the like which is False by default
Oh, many packages... Hmmm
@Zane I doubt you could share across many packages. SSIS runs each package separately and the packages set up their own DB connections.
I'd have to test, but I think using a parent/child arrangement with retainsameconnection set on all would work. Sounds reasonable at least
You're thinking the time differential that you're experiencing is due to connection logins?
I had a job time out this weekend citing it waited a very long time to log in and ultimately gave up
I have a control package that runs a bunch of other packages in a Sequence Container I should be able to adjust the setting there.
@JNK I think I need to start learning Powershell.
JNK
JNK
@Zane It's easy once you get going
@Zane everyone needs to start learning PS :)
JNK
JNK
16:06
We can't use SSIS internally
not yet at least
so I had to roll my own ETL control solution
If you already know a .NET variant, powershell isn't bad.
@billinkc #SkillsIDoNotHave
JNK
JNK
I have a multi-tiered job structure, and subjobs run within transactions, logging happens through a separate SQL connection, and you can set dependencies to allow parallelism
it does a top sort on steps and subjobs to make sure they run in dependency order
You can learn .NET through PS, I didn't know any before I started scripting
Favourite reason for loving PS is this: something is broken and I need to fix it. I can write a .NET application, send to DBAs saying "please run on the production server" and get laughed out the state. Write the same thing in PS since "it's just a script" and ask them to run and it gets done.
2
They could review the code but they won't whereas an EXE is a scary black box
16:23
@billinkc BINGO!
@ConcernedOfTunbridgeWells 240GB would be plenty for all the VMs we are likely to ever run, so 4x240 (RAID + warm standby server)
@ConcernedOfTunbridgeWells have you had a play with one of those?
@JackDouglas No, but I've been idly considering whether I should get one for my dev machine. However the 800GB ones are about £1,500 so I'll probably stick with my 320s for a while yet.
The guranteed performance consistency is a nice feature and they're way, way cheaper than the pulsars and suchlike from Seagate et. al.
@billinkc My favourite reason for using Excel/VBA as a dev platform for odd little satellite systems is that you can deploy it by email without having to involve production at all ;-}
Not that I would dream of deploying applications into production without going through the appropriate process.
@billinkc You're damn right it is. I don't know what you pack in to that .exe and I won't be arsed to parse your classes and inheritance model. A script that uses known and vetted objects is fine in my book.
16:39
@billinkc or if you really know ECMAScript
@jcolebrand are they connected or similar in some way?
Both are dynamic
powershell objects aren't really typed.
Some things are typed, but not all of them.
Ok, now I KNOW the LinkedIn endorsements are crap. I just got endorsed for SSAS.
@MikeFal trololol
ah, I see what you mean, in that way PS is unlike the rest of .NET, right?
16:45
@MikeFal Given that it pops up random contacts and badgers you to endorse them I'd take it with a grain of salt. However, like all such things not playing the game can have negative consequences so you're faced with Hobson's choice.
@JackDouglas aye
@ConcernedOfTunbridgeWells True enough
@JackDouglas PS really wants you to set up cmdlet libraries that are PS-specific plugins, although it can consume .NET APIs.
WSH will consume COM APIs. I didn't think MS ships a .Net-aware ECMAScript with Windows, although I may be out of date.
there is JScript for WSH, but tbh it's easier learning PS
Anyone who wants to script on Windows platforms today should learn only powershell.
2
@ConcernedOfTunbridgeWells you must not have read much on Windows8?
16:51
@jcolebrand That looks like a browser hosted app.
@ConcernedOfTunbridgeWells It's intended for a native OS app no? I didn't study that article.
I just know that the underpinnings of Windows apps moving forward are a cross between sandboxed js/html apps and .NET apps.
@jcolebrand It looks like a HTML5 app.
the JS engine has some hooks specifically for .NET libraries, much like PS does.
That's really the beautiful thing about .NET and even JRE. F' the languages. Don't like one, get another one that is more to your cup of tea. Just stop re-inventing the wheel for IO, string manipulation and all that junk.
@billinkc That's why we enthusiasts are pursuing things like the V8 core as the underpinning for a common JS runtime, and things like the module loading pattern, so we all agree on one common IO interface, as it were.
16:56
Ah, v8 core en.wikipedia.org/wiki/V8_(JavaScript_engine) Was not familiar with it but yes, I approve. Carry on with it
@billinkc it's googleish
My mother's side hails from google so I'm like an 1/8
My ability to concentrate is at 0 on a scale of 1 to infinity
@billinkc me too
@billinkc join my club.
this query is horrible
-3
Q: set index for this query in sqlserver

Pouyai'm starter in sqlserver indexing. i have one table with this Structure CREATE TABLE [dbo].[Report3]( [Id] [int] IDENTITY(1,1) NOT NULL, [Mesc] [nvarchar](50) NULL, [Line] [nvarchar](5) NULL, [Unit] [nvarchar](5) NULL, [Discription] [nvarchar](500) NULL, [InvQty] [bigint]...

17:17
@billinkc Let me sing to you the song of my people: www.youtube.com
17:34
@jcolebrand Unfortunately it's not portable yet, is it?
PowerShell?
@jcolebrand Right, like I had a Perl script which was completely portable between Windows and Linux connecting to SQL Server through ODBC.
There are few things I love more than when support comes to me with a problem and it if fixed with appropriate indexing.
Looking in an actual execution plan, is there a way to quickly discern whether I'm subject to parameter sniffing? Is it a matter of running same proc with a different value and comparing plans?
Well, no.
but then again, neither are WSH scripts
nor js for the most part
17:37
@billinkc on the execution plan check that the "estimated number of rows" is on par with the actual number of rows
Looks like Plan Explorer will already tell me that sqlblog.com/blogs/aaron_bertrand/archive/2010/12/22/…
@billinkc And even more if you install a more current version :)
@billinkc not fair, you didn't ask for the wonders on plan explorer
But yes, you will want to look at the parameters tab
@Lamak It's visible in SSMS too
@PaulWhite yup, that's why I was saying that he should compare the estimated number of rows with the actual number of rows
but is easier with plan explorer
17:45
@Lamak No, not that, the parameter values, compiled and runtime
Properties window
@PaulWhite well....didn't know that ;-)
@CadeRoux and you never had any issues with that setup? ;)
Plan Explorer does contain a lot of nice things to make the information more presentable, and fix a few bugs etc., but it can only pick out what's already in the plan XML (and therefore often in SSMS properties)
@JackDouglas Surprisingly no, but the ODBC on Linux was not the best - and everything else on Linux is problematic and requires constant trawling of the Internet. I'm just saying if I had to write a script and I knew it might need to be portable, I would rule out PowerShell immediately (unfortunately).
@jcolebrand If js with node got a lot more mature real quickly...
@CadeRoux what do you mean? It's production usable right now
17:52
@billinkc So that setting has solved all my problems.
And you can use node to script stuff on any environment, and you can distribute the node files between platforms. Especially if you use stuff like "path.join" instead of appending your own slashes.
bully!
@jcolebrand Do they have a SQL Server connection now?
12
Q: Connecting to a remote Microsoft SQL server from Node.js

A Wizard Did ItI was wondering if anyone was aware of a way to connect to a Microsoft SQL database from Node.js. I'm aware of the MySQL drivers, but I have data that I need to pull from a MS SQL database and would rather pull directly from Node.js rather than hack a PHP script of some sort in place.

do you want a CLI module or one for running queries?
18:11
Hmm... this question looks like it might get migrated to dba.se... but I don't think they'll want it there either.
-2
Q: Can not connect MS sql server 2008 R2

JohnI have problem connecting SQL Server 2008 R2, Yesterday I connected adn now I can'nt and get this error!

@MichaelFredrickson ugh. There is no question there.
@jcolebrand I would want something which could execute stored procedures with parameters and deal with result sets completely portably between Windows and Linux (assuming an ODBC connection already set up on Linux). Bulk load is probably out of the question on Linux because TDS doesn't support it, but that would be really nice.
@CadeRoux then you want a standard MS SQL client interface, not the CLI.
@jcolebrand Yeah, out of all those on that page, only Tedious looks like it might work and it's still in infancy.
@PaulWhite Thanks for the reply @PaulWhite... after the DBAs researched it some more, the wait type turned out to be RESOURCE_SEMAPHORE... I believe they're just using the DMVs to determine this...
@PaulWhite I think we're just screwed... we're still running 32-bit for some unholy reason... and this just seems to be one of many issues that have resulted from that.
18:22
@CadeRoux we should discuss this over the weekend when I'm more likely to concentrate on it. I'm sure I can help you find something that should work.
@MichaelFredrickson RESOURCE_SEMAPHORE is a wait on query workspace memory grant, nothing to do with tempdb ;c)
But seriously, how many different platforms are you administering SQL Server from?
@PaulWhite Yea... sorry for the red-herring...
@MichaelFredrickson No worries, just making sure you knew. I wonder why you have so many queries waiting for memory? Some hardware to buy or queries to tune there I'd say.
@jcolebrand I would prefer to only be on Windows. But client was reluctant to spin up functional Windows Server separate from the SQL Server for these loads. Right now it's on a Windows VM in the cloud because of that. It's kind of silly. But after having to deal with that and seeing how well Perl handled the early experiments, I have to wonder why we don't have a cross-platform PowerShell. Windows is still easier to deal with for support and troubleshooting, so can it be all about OS sales?
18:28
But if you're worried about supporting MS SQL Server, won't you always be in Windows Land?
@PaulWhite I think I just have a perfect storm of things that consume NonBufferPool memory... the applications open tens of thousands of connections to Sql Server (Don't use connection pooling), extended stored procedures, OLE automation, very very large query plans... It's been a problem for years, and I think the consensus is that our only viable fix is to get onto 64-bit.
@MichaelFredrickson time for a code rewrite?
@swasheck Very much so... it's a problem with the executives though. It was a startup where the founders of the company who wrote the original code are now the CTO, COO, CEO, etc... so in their minds, the code has worked fine for years... so if there's a problem now, it has to be in the database and its administration.
@MichaelFredrickson because data never grows
At some point, code can't overcome the limitations of the system. I'd definitely be pushing for a 64-bit upgrade. Plus probably beefier hardware, but I don't know your specs.
18:35
@MichaelFredrickson Crikey, you must have -g set to something horrible. 64-bit and more physical memory might help, but you're going to have to address the underlying causes at some stage. #TellingYouStuffYouKnow
@MikeFal well this too. it's easier to throw hardware at the problem. but by doing that you make yourself look foolish when , 3 months down the road, the same old problems resurface
then you've lost some credibility in the "you need to rewrite your code" game
@swasheck Sure. It's incumbent on me as a DBA to prove my case. But you can't cram the proverbial 10 lbs of crap into a 5 lb bag. There comes a time when, no matter how good the code, you need better hardware/system.
@jcolebrand Yes, that's how silly it is that they won't simply stand up a Windows machine for these things. Since we're starting to generate Excel reports from SSIS, they've basically committed to Windows for more other processes now as well. I think they have more servers coming in or something, but this is kind of inconsequential - I'm using the smallest Amazon VM.
As I said, I wouldn't advocate better hardware until AFTER I upgraded to 64-bit SQL and knew the specs better
@MikeFal oh, i'm not necessarily disagreeing with you at all. also, you're much better at this than i am so i'll usually defer to you. i'm just noting the politics that surround situations like this. find the biggest pain point and proceed with caution
JNK
JNK
18:40
@ConcernedOfTunbridgeWells you around?
JNK
JNK
I have a (hopefully) fast DW modelling question
I have an existing DW that has some attributes about special folders
@PaulWhite -g768; The server has 48gb of ram... does that constitute horrible? The DBA who originally advocated for that setting has since resigned, so I can't speak to the reasoning behind it.
JNK
JNK
we are expanding it and need to add some security info
basically I think it will boil down to a list of AD groups that have access to the specific folder on a specific date
should I do this as it's own time-bound dimension or what?
@CadeRoux what platform are you supporting it from?
18:43
@swasheck Better than you? Psh, I just have a big mouth and talk to much.
@MikeFal i only talk when i have something unimportant to say
@JNK Is this a mechanism to manage the security?
@jcolebrand Various. I do SSIS development mainly on a Windows workstation, but can also do it in BIDS on the Windows Server VM, sometimes remotely from Chrome OS or OSX. Sometimes I edit the scripts on the Mac - whatever.
@jcolebrand The early ETL didn't really require Windows since I was bulk loading outside of SSIS, but now that we are doing quite a few Excel exports, Windows is kind of required for SSIS. Still, Linux would probably be preferred for them because of their reluctance to add a Windows functional server.
@jcolebrand But in that case, there would be a whole lot more to research about generating Excel spreadsheets in node.
JNK
JNK
@ConcernedOfTunbridgeWells Nope it's just data on our file system
the security is managed elsewhere
this is basically so we can know who had what access to what data on what date
@CadeRoux they're either XML (.xlsx) or CSV. Either of which is easy to do in Node.
JNK
JNK
18:50
I'm working on it now and I think I might do a related fact table
checkout easyxml from npm
JNK
JNK
It'll need a 1:M relationship to the main folder fact table
With a row per person/group per folder
or is that really a dim? I guess there's no measures in it besides what access they have
@JNK For a cube it's probably better to do a daily snapshot by group by folder, although that will use lots of disk. For a SQL report you could do something with date ranges and just report any access records where the date falls in the range.
@jcolebrand It's actually xlsm because I have to have a macro to update pivot tables on the dashboard worksheet and data types on the data worksheets because of SSIS issues with numbers as text. That might not be an issue with an excel library in node that lets you rapidly fill multiple worksheets and gives you decent control over the datatypes of different columns - a la the old-school VBA Excel COM automation, which SSIS doesn't really do in it's Excel Destination mode.
@jcolebrand Another process is loading spreadsheets, processing them to generate exception reports in Excel and then potentially applying the changes.
ugh
give me the freedom to build the application infrastructure please. That's just ridiculous.
Management by Excel is no way to run a company
JNK
JNK
18:55
@ConcernedOfTunbridgeWells would that technically be a dim or a fact? Dim right?
@JNK For the cube, a factless fact.
3
JNK
JNK
ok
It's not gonna be a cube yet thankfully
but that's in the plan for this release
For a SQL report, a factless fact with the date ranges (from, to), the folder and the AD group
Presence of a record indicates access between the from and to dates for that group
JNK
JNK
well it won't be as simple as that because I have 20-some bit values for various access rights
I'm denormalizing that out too
@jcolebrand Well, it's the shoemaker's children - all their development resources are on their customers and distributors. There's all these partners doing administrative sharing and I don't think they have any resources to automate on their side either, so sadly it's going to be spreadsheets for data interchange. And offline reports via email including data which they can also play with are a requirement.
19:09
pinging @AaronBertrand. Why didn't my answer worked here?
0
Q: How to randomize a foreign key value in SQL?

ShaulI have a table MyTable, which has a foreign key field OtherTableID. I already have a few thousand rows in MyTable. Now I want to randomize OtherTableID so that it has some random (but valid) value of an entry in OtherTable. Any ideas how to do this in one neat query, short of using a cursor?

I remember now seeing this issue before, but I conveniently forgot that before answering
@Lamak because the subquery is only evaluated once. To see this:
SELECT *, (
SELECT TOP 1
ID
FROM
OtherTable
ORDER BY
NEWID())
FROM dbo.MyTable;
@AaronBertrand I did try it afterwards and realized the same
but I thought that the purpose of that subquery and OUTER APPLY was somehow to not evaluate that query once
There are probably more efficient ways than my row_number() trick but it's fairly intuitive IMHO.
@Lamak that depends on where you apply the apply. In your case, you applied it against the same value every time.
@AaronBertrand and how should I apply the apply for it to work?
@Lamak I'm not sure, I've never used apply for this trick, since row_number is more intuitive to me.
:-)
19:13
some users suck
What would the PHP be to output this? — Talon 5 mins ago
@AaronBertrand yup, I upvoted your answer. But how would you do the same with truly random values from the other table, not caring about duplicates?
@Lamak off the top of my head, other than forcing a scalar UDF, I don't know. Let me think about it a bit.
@AaronBertrand right. Cause I do think that that was what op wanted
@Lamak I read it as "I don't care about duplicates" not "I absolutely want duplicates."
@AaronBertrand I know. I just think that the "don't care about duplicates" was because he wants truly random values from the other table. But, that's just my interpretation
19:18
@Lamak "don
't care about duplicates" in my interpretation means that he'd be happy with an answer even if it provides duplicates. If he wanted duplicates, he wouldn't have stated it that way.
I see your point. But the way I see it is not that he really wants duplicates, but simply that he wants random values, not caring about duplicates. The way you did it (and I upvoted your answer because its a valid interpretation), kinda gets values that aren't "truly random", because it prevents duplication. I'm actually only asking because I would like to know what I had to do to make my version of the query work
@billinkc can you post that as an answer so that I can give you credit?
19:33
10. SOLVE THE FIZZBUZZ PROBLEM WITH SQL CODE.

Here’s a quote of the FizzBuzz problem:

Write a program that prints the numbers from 1 to 100. But for multiples of three print “Fizz” instead of the number and for the multiples of five print “Buzz”. For numbers which are multiples of both three and five print “FizzBuzz”.

Challenge the DBA to do this on a whiteboard with pseudocode.  The code doesn’t have to be perfect syntax, but we’re looking for the ability to solve this problem clearly and quickly.  I’d ask this of any type of DBA, production or development.
Isn't the best way to do this in "pure" syntax to use a number table and a case statement?
@jcolebrand Yes, that would be the easiest solution... but if you want to be pedantic.. the requirements call for print, which might exclude the use of a set-based select approach.
oh, true
using print makes it more awkward.
I suppose then that you have to drop to a cursor huh? I would prefer not to?
@jcolebrand I think it would be a better question if it didn't say print... and see if they come up with the preferred set-based approach like you did...
Wait, we're talking about the "quote of the FizzBuzz problem" right?
@bluefeet var_dump would work just fine
19:40
@jcolebrand a cursor... or if you want something really ugly, you could have a select statement that builds up a dynamic sql command to execute 100 print statements...
Traditionally that's done in a language with a console...
@MichaelFredrickson that would be better to me than a cursor, no? :p
@jcolebrand I would give bonus points to the candidate who did it in the result set. :-D
@BrentO question about the deviousness of http://www.brentozar.com/archive/2009/01/top-10-interview-questions-to-ask-senior-dbas/ … should it TSQL _print_ or just select into a result set? ;-)
@jcolebrand why do you think a while loop or a series of PRINT statements you built in a loop would perform better than a cursor? They're all cursors.
@AaronBertrand I think that that solution would perform more poorly than a result-set (which is probably not the right name, but that tabular data view that I can use programmatically)
to me a TSQL while statement is the equivalent of a cursor, regardless of syntax.
@jcolebrand you seemed to imply that "a select statement that builds up dynamic SQL" would be faster than a cursor.
Unless you meant something else by "better"
@AaronBertrand oh, no, by better I didn't mean "faster"
I just meant more like "easier to read" but not just for that reason
19:45
@dezso thank you sir
Seems like it would just read easier
I still prefer a numbers table approach
The rest of the options just seem ghastly
@bluefeet I'm here to help :)
@jcolebrand that depends, of course. Some people like blondes better than redheads.
@AaronBertrand one of each?
@AaronBertrand wait, who doesn't like redheads? ;-)
19:46
@jcolebrand if the object is to PRINT, though, that's like saying I'd love to get to work in a Ferrari. That's only useful if you have access to a Ferrari.
@AaronBertrand hence I asked BrentO for clarification on his intent.
@bluefeet you must handle it with care - it certainly outputs whatever it gets as a parameter, not necessarily fitting OP's (not yet known) specs
@dezso even though it is so late in the day.
and fwiw
is the name of the grid of results I get back in SSMS when debugging a query called a "result-set"?
@dezso I told them that they should post a new question with their php code to ask how to incorporate the two together
19:48
Seems like that would be a basic terminology I would understand
@swasheck I was careful to not say "blondes over redheads" so that it wouldn't degenerate
@AaronBertrand good call
@jcolebrand yes, but without the dash (and with or without a space)
I'm already thinking of texting a redhead friend of mine now when I goto lunch ...
@AaronBertrand kk. Thanks
@AaronBertrand you seem to know the heap well
19:50
@jcolebrand No, I just got lunch. But thanks anyway.
@MikeFal hahaha, well played sir.
@bluefeet is it?
@MikeFal salkdjfjkcc0e4839jfcl;lke 980c4=329tg
@dezso compared to the normal early hours that I first pop in.
@swasheck I agree he's not nearly as good looking as the redhead I was gonna call
19:56
what?
1
A: Dynamic sql syntax issues for date time variable

Syn123Have you tried matching the case when you call the variables? it's possible your schema is case sensitive.

@bluefeet I see. Anyway, added a pointer to relevant docs there
00:00 - 20:0020:00 - 00:00

« first day (783 days earlier)      last day (4382 days later) »