« first day (358 days earlier)      last day (4516 days later) » 

6:24 AM
@ConcernedOfTunbridgeWells I think "autonomous" is probably the best of the bunch as far as naming goes :-)
Here's the SO version:
1
Q: postgresql view with max min with id

Random JoeI have the following table: CREATE TABLE trans ( id SERIAL PRIMARY KEY, trans_date date, trans_time time ); I want to have the following view CREATE OR REPLACE VIEW daily_trans AS SELECT trans_date, max(trans_time) as first, min(trans_time) as last, calculate_...

@gbn please flag for migration on SO if you agree with me it fits better here (see comments on the dba.se version) then we can close ours as an exact duplicate.
(I've already flagged it myself)
 
6:57 AM
@ConcernedOfTunbridgeWells There are at least two ways to get autonomous transactions in SQL Server: (1) blogs.msdn.com/b/sqlprogrammability/archive/2008/08/22/… (2) using SQLCLR with Enlist=false...then there's always the table variable trick too, I guess
 
 
1 hour later…
gbn
8:04 AM
I've just flagged half a dozen from my SO favourites
 
gbn
8:15 AM
@ConcernedOfTunbridgeWells Also stackoverflow.com/questions/2322260/…
@ConcernedOfTunbridgeWells I'm more of a SQL Server chap, MySQL is what I have to do to put food on the table...
 
8:44 AM
@SQLkiwi Both of which are essentially hacks to get another DB connection outside of the current transaction context. It can be done, but it's not directly supported by the system.
 
@ConcernedOfTunbridgeWells True, they are hacks. Nevertheless :)
 
gbn
Do you really need autonomous transactions?
My view is that any DB call should be atomic
I don't even use SAVEPOINTs in SQL Server, not least you're bollixed with SET XACT_ABORT ON
IIRC
 
@gbn They are quite useful for a few applications. One example is logging error messages so the message is persistent even in the event of a rollback.
 
gbn
And frankly, most code monkeys aint going to know what to do with them
@ConcernedOfTunbridgeWells tablke variables will do that
Or SET XACT_ABORT with TRY/CATCH
You can always log in the catch block because @@trancount is zero on error with XACT_ABORT
23
A: Nested stored procedures containing TRY CATCH ROLLBACK pattern?

gbnThis is our template (error logging removed) Notes: Without XACT_ABORT, all TXN begin and commit/rollbacks must be paired @@TRANCOUNT must be the same on entry and exit BEGIN TRAN incremenent @TRANCOUNT COMMIT decrements @@TRANCOUNT ROLLBACK returns @@TRANCOUNT to zero so you'd get error 266 ...

also deals with client command timeouts. A normal timeout returns the connection to the pool bit locks and transactions still persists. SET XACT_ABORT ON fixes this
 
@gbn Yes, that would work. It still puts you in the business of explicitly handling exceptions and passing them up the stack if you go more than one level deep.
 
gbn
8:53 AM
@ConcernedOfTunbridgeWells I'm happy with that. We used a stored proc in the CATCH block that dealt with it wll. A catch block was always 3 or 4 lines
ERROR_MESSAGE is still in scope in a stored proc called in a catch blokc
 
However, it's not all that often that you want to do that sort of thing in application code unless you have really complex transactions.
 
gbn
+ we did reuse a lot of code, helper procs etc. And triggers
We didn't, just code re-user
Actually, we did have some logic wrappred up in procs.
very rare we had single table writes
 
In practice, I ended up doing the error logging from SSIS if it was in ETL code. On Oracle, if you do error logging within a PL/SQL package, autonomous transactions are handy for that.
 
gbn
@ConcernedOfTunbridgeWells Agree, I'd log from the ETL package if I was using that
 
Although it's been some years since I did much work with Oracle.
 
gbn
8:56 AM
In the early days, our client was a lot of Excel and Access
pre .net 2 IIRC too
 
Bearing in mind that with Oracle you have to pay extra for OWB, and you might well just be wrapping a bunch of stored procedure code with a shell script, you do have to think in terms of the sprocs doing their own error handling and logging.
In a lot of ways I think that the accessories (SSAS, SSRS, SSIS) that come bundled with SQL Server are one of its biggest strengths. You don't get any of that out of the box with Oracle.
You get SQL*Plus, SQL*Loader, shell scripting from your host and PL/SQL. Oracle really assumes decent scripting facilities on your host, I think. On the couple of occasions I had to deal with it on Windows I ended up installing cygwin or SFU.
 
gbn
@ConcernedOfTunbridgeWells Yes
No hidden costs
Barrier to entry is lower with SS. That is, if you'0ve just shelled out your first born son for Oracle you aint going to let code monkeys near it without adult supervision
SS is taken less seriously
 
9:19 AM
@gbn I'v seen a fair bit of PL/SQL code that was in dire need of adult supervision ;-}
 
gbn
Shit code is the norm
 
Although, I've seen far, far more amateur T-SQL code.
I still see Oracle snobbery and fanboi-ism from time to time, but not nearly as much as I used to. I think SS is getting quite a lot of mindshare in B.I. circles at least, although there are still no shortage of mouth breathers in that racket.
 
gbn
One major thing IIRC is T-SQL is SQL and language mixed, whereas Oracle keeps SQL and PL/SQL separate. This correct?
 
Actually, most Oracle pros (ones that I would take seriously anyway) that spend any time on SQL Server tend to end up liking it.
 
gbn
I was in a mixed DBA team at one Swiss bank. (SS, Oracle, Sybase).
No particular beefs, just genuine interest in each otehrs platform
 
9:24 AM
@gbn Sort of. PL/SQL is a pascal-ish language based on Ada with a built in embedded SQL facility. The SQL interpreter used in it is not the same one that processes pure SQL queries, and they used to have slight dialectic variations.
 
gbn
Other banks tend to have SS/Sybase teams
I know Ada from my electronic warfare coding days
Well, used to.
 
When I was in NZ I worked with a couple of Oracle DBAs that did quite a lot of with with SQL Server as well and said they had seriously revised their opinions of it. I went the other way, then back to SQL Server as a B.I. platform, although that was more a function of what the market I'm working in uses.
PL/SQL has a similar syntax (BEGIN/END block structure etc.)
 
gbn
I find the MySQL fanboi -ism amusing nowadays
 
Never used Ada per se, but the syntax of PL/SQL vaguely pascal-ish
@gbn Never encountered MySQL fanbois in quantity, but the outfits I work in are all fairly stodgy, conservative insurance companies. Either large corporates or smaller Lloyd's syndicates run by ex-RSA people who still have that mindset.
 
gbn
I'm meeting them now in Malta. Gaming companies, open source, free
Which is amusing given the whole "free" stack is owned by Oracle now
reviewing my bookmarks
 
9:31 AM
@gbn For that reason I tend to assume that MySQL will stay a bit limited in its feature set and you'll have to look to one of the forks for any real progress.
 
gbn
I'm getting there in changing some minds
 
@gbn That looks familiar. I think I've seen it before.
 
Actually I think the biggest ivory tower of the lot is 'enterprise' software - ERP systems, high-end B.I. tools, network monitoring tools, even SANs. They tend to be closed shops, and often the biggest fanbois on the planet. Try talking to an informatica fanboi sometime.
 
gbn
It was the ETL tool of choice at my last bank
 
9:43 AM
Essentially, none of the above is rocket science, and it tends to attract people who just want a gravy train. Once you know the tool, you can get work just by knowing it, inspite of the fact that a competent developer could pick it up fairly quickly. I used to see that a lot with Informatica and Cognos around 2004-2005.
Anyone with a few clues could pick up either tool in a few days, but the ads all wanted 2-5 years experience with them.
Do you really want to employ somebody that just wants to do Informatica for 5 years?
 
gbn
If it reinforces the team outlook and prejudice
The difference between Private banking and Investment banking outlook was educating
matches what you say above in the PB world
 
You do get it with Microsoft as well. I've dealt with quite a few MS fanbois in the past.
 
gbn
Intel vs AMD
nVidia va ATI vs 3dfx as was
Apple vs PC
 
Well, you can ask @JackDouglas how many opteron based HP workstations are sitting behind me now.
:D
 
gbn
I don't care particularly. Without RAM and IO speed you're buggered anyway
As you know...
If you max your CPUs then you have bigger problems with design and indexing usually
 
9:51 AM
Yes, I built these boxes to get reasonably fast disks into a development workstation so you could set up environments locally.
The real eye-opener about these machines is that with 6 disks I can make them outperform any SAN based production environment I've ever deployed to.
Which might go a long way to explain why I'm fairly cynical about SANs these days.
However, the CPU was more or less irrelevant, except that it was the only option for a 64 bit machine that didn't cost an arm and a leg at the time.
You could probably say I'm an XW9300 fanboi.
(for ETL jobs anyway).
One point to note about these is they have 2 PCIX-100 and a PCIX-133 slot on the motherboard, so the I/O is fairly quick (at least by the standards of the day). That's really their main claim to fame.
The CPUs aren't anything special by modern standards. Individual core speed on a Nelahem or Core I7 would be faster.
 
gbn
like I said, doesn't matter too much
I chose my desktop CPU based on slowest/cheapest in that family with bigger cache of the 2 at the time
I don't do MHz. not since I overclocked my Duron with a pencil a decade ago
 
10:14 AM
The CPUs in these machines are either what they came with (I got them secondhand - new ones are quite pricey) or what happened to be going on Ebay at the time ;) Some of them have low wattage CPUs in them, which keeps the fans a bit quieter.
But, I/O is a much bigger deal and that's what I got these for. They also have reasonably good fit and finish by PC standards which saves on the odd cut finger.
 
gbn
yeah, I have an older Antac quiet case
 
Occasionally someone mentions Z800s and I think I'd like to get one of those, but then I wake up and realise there's nothing wrong with the (nearly 5 years old now) XW9300s.
 
gbn
lordy
Just seen table aliases a, b c and d
 
It's been a long time since CPU speed mattered much on a PC, and a machine with fast disks shows just how I/O bound modern PCs really are.
 
gbn
I have an SSD in my desktop now
Intel X25 M
was the best at the tiome
v2
 
10:24 AM
First generation Opterons. They have a bastardised OEM version of a Tyan S2895.
I've been thinking about SSDs for a while now. They're probably the only real incentive I have to upgrade.
 
gbn
and the aliases aren't used in the SELECT clause
@ConcernedOfTunbridgeWells I use my desktop for messing around and gaming
not real work. But the SSD is the single best thing I've ever bought for it.
 
These were built so they had fast enough I/O to develop ETL jobs on - they have SCSI disks. I've been thinking of retrofitting SSDs to them, but they have PCI-X slots so they're a bit of a dead end for peripherals. There is a SATA controller on the motherboard but it's an old-ish fakeraid type.
 
gbn
My netbook doesn't like an SSD.
Need to fully native AHCI to get the best (at desktop level)
 
Having said that, they make fine desktop PCs for just messing around as well. I'm using one now, and these days it doesn't get used for much but surfing the web, playing games and odd jobs.
They're not worth much anymore.
 
gbn
Some bloke I used to work wiith (upto 2001) had a desktop with 6 SCSIs for soem reason
Ran Windows 3.11 too
real masochist
The controller had to start the disks one by one to avoid power drain issues
 
10:31 AM
Fortunately the PSU on these is up to running the disks. I've put relatively modest graphics cards in them to keep the power load down, though.
They run ETL jobs swimmingly.
Although £1,000 worth of disks is a lot for a PC.
OTOH it beats waiting 6 months for someone to get around to buying a server.
Probably not so bad - still way less than the cost of the software on it.
 
 
2 hours later…
gbn
12:31 PM
14 SO posts migrated here from my favourites :-)
 
1:03 PM
@gbn oh boy
 
gbn
and more
 
without exception I think SO are better off without them - and they are right at home here
but I'm guessing some feathers are going to be ruffled
eg Bill Karwin got 97 upvotes on one of those
so that rep will migrate too :-)
(at least I think it does)
good work, and lets batten down the hatches :-)
 
gbn
@JackDouglas I voted him twice now though :-)
he should be hanging here anyway. Clever chap.
 
1:37 PM
howdy chaps
 
gbn
Hello
 
 
1 hour later…
3:12 PM
0
Q: Why are database developers' Q&A migrated to DBAs site

AlexKuznetsovThe following link is an example: How SQL Server handles concurrent requests? Why was it migrated to DBAs site? I think it was a wrong decision.

please respond graciously
if you care to respond that is :-)
 
gbn
nah
I'm not nice enough
It demonstrates the attitude of developers towards anything "dba" if nothing else.
 
I'm going to invite him in here
 
3:34 PM
Well I hope he decides to come round
 
4:14 PM
@JackDouglas I've had rep migrate to here (or least it appears to have migrated) from questions flagged off SO, but it doesn't seem to have disappeared off there. Maybe it will go if they run a recalc.
 
gbn
@ConcernedOfTunbridgeWells just do stackoverflow.com/reputation to see the difference
I'm about 500 higher on SO than I should be because of migration, mostly
around 300 or that was for today
The /reputation works on all sites too
I'm 60 too high on dba,se
 
@gbn I can see a difference between my displayed rep and the rep from that report, and my rep on dba.se jumped a few days ago when some questions I had answered got migrated here, so I guess the rep moves with the migrations. Maybe they will re-calculate the SO rep at some point. I had the impression that this isn't done regularly.
@JackDouglas It would be nice to get a few more MVP types behind dba.se.
 
gbn
@ConcernedOfTunbridgeWells We should persuade Brent O to persuade them...
 
@gbn Mike Walsh also
 
4:47 PM
@ConcernedOfTunbridgeWells yes it would - but I'm already smiling because of this:
 
5:12 PM
@gbn Hey! I'm a developer :)
@gbn Shall we discuss the name of dba.se again ha ha
 
5:31 PM
@gbn Doh! Hit recalc and dropped 50!
 
6:08 PM
seeing more db corruption questions recent, why do the muppets never get the tail of the tran log before screwing up all chance of successful recovery...
 
@MartinC Usually as they have no idea what that pesky log thing is for :)
 
 
1 hour later…
7:15 PM
@MarkStoreySmith What is this recalc you speak of. Is there a feature somewhere to recalculate your reputation. I am getting out of touch.
 
dba.stackexchange.com/reputation and scroll to the bottom of the page
click for a recalc
and instantly lose some rep :)
 
@MarkStoreySmith About 250 in this case, but some stuff I had answers on got migrated to dba.se recently
 
Starting to wonder if beer is the only thing that will save me from the mound of codeshite I've been staring at all afternoon.
 
7:31 PM
@MarkStoreySmith Absolutely - either that or cider.
 
8:04 PM
@SQLkiwi, @MartinC and anyone else that's mastered SQL XML trickery... is what was asked for in this Q possible stackoverflow.com/questions/5569282/…
 
@MarkStoreySmith Some of it is possible but to match that requirement it's easier to push the task to sqlclr c# sp, also that requirement is strange as the detail record can only be singular. Normally it would be one row per <Detail> tag.
 
@MartinC I'm attempting a hack job/poc spike for a spot of Solr integration. Basically want to dump some records into a solr indexable xml file like wiki.apache.org/solr/UpdateXmlMessages
requires denormalising it into a similar schema to that question, whereby the column is a the value of a fieldname attribute
yucky
probably easier to knock up a console app than query it
 
8:20 PM
Testing something:
14
Q: Design for Database Administrators

JinI'm Jin, and I'll be working on the designs for the Stack Exchange sites as they graduate from the beta phase. Each site will have its own unique theme that will reflect its topic. However, all sites will share common elements so they feel like they're part of the Stack Exchange family. First, t...

 
If you know the column list it can be done in sql, the issue with that question is the dynamic requirement on the column list
 
I've got a fixed column list
Any pointer articles?
 
8:37 PM
Are there lots of columns? or just a couple as unpivot is a PITA
 
Ultimately ~100, initially (for this spike) a dozen
Is it an unpivot job rather than using xml syntax?
 
9:02 PM
This is part of the way but I'm having trouble remembering some syntax
    SELECT		master.id as "@id",
			detail.columnname AS "@columnname",
			v+''
FROM		(
				VALUES
				(123),
				(456)
			)	AS master(id)
INNER JOIN	(
				VALUES
				(123,'Customer','John Smith'),
				(123,'Amount','888.45'),
				(123,'Date','01/01/01'),
				(456,'Customer','Suzie Jones'),
				(456,'Amount','1000.25'),
				(456,'Date','05/05/01')
			)	AS detail(id,columnname,v)
ON			master.id = detail.id
FOR XML PATH('Detail')
 
9:14 PM
arrgh I've just remembered how much I hate the combo of T-SQL and XML
SELECT		master.id,
            detail.columnname,
            Cast(v as xml).query('.')
FROM		(
                VALUES
                (123),
                (456)
            )	AS master(id)
INNER JOIN	(
                VALUES
                (123,'Customer','John Smith'),
                (123,'Amount','888.45'),
                (123,'Date','01/01/01'),
                (456,'Customer','Suzie Jones'),
                (456,'Amount','1000.25'),
                (456,'Date','05/05/01')
            )	AS detail(id,columnname,v)
@ma
@MarkStoreySmith the abomination above with some form of unpivoting is a good start
 
10:00 PM
@MartinC Much obliged, I'll give it a hack in the morning
 
@MarkStoreySmith it might be possible to do this without unpivoting the data, I'll have a look at the xquery statement based on Listing 7 in ibm.com/developerworks/library/x-xdxqry.html
 
Glad to see it isn't just me that hates the SQL+XML combo :)
 
@MarkStoreySmith it's the I'm not going to give a useful error message and I'm not going to work at all until everything is perfect which drives me nuts
 
Too true, its like coding with your eyes closed until it magically works
 
10:30 PM
@gbn you seen this?
Oops, where is it
3
Q: Why are database developers' Q&A migrated to DBAs site

AlexKuznetsovThe following link is an example: How SQL Server handles concurrent requests? Why was it migrated to DBAs site? I think that at this time such questions get more exposure on stackoverflow. As such, they have a much better chance to get relevant answers. I am not trying to make a blanket state...

The answers are golden
 
11:22 PM
@MarkStoreySmith I've worked out how to do the main unpivot using xquery, now just need to know how to do nested loops
 
11:46 PM
@MarkStoreySmith Answer posted for the Question stackoverflow.com/questions/5569282/…
I feel dirty after using XQuery, it's just wrong
 

« first day (358 days earlier)      last day (4516 days later) »