September 13, 2018 at 2:32 pm
Jeff Moden - Thursday, September 13, 2018 11:57 AMBut it's fast, right? :D:D:D
It took almost 16 minutes to copy about 80K records from one database to another on the same server, so at least it's faster than molasses in January. There are no major transformations, no aggregations, just a simple copy with the aforementioned lookups into the EAV tables.
Drew
J. Drew Allen
Business Intelligence Analyst
Philadelphia, PA
September 13, 2018 at 2:42 pm
drew.allen - Thursday, September 13, 2018 2:32 PMIt took almost 16 minutes to copy about 80K records from one database to another on the same server, so at least it's faster than molasses in January. There are no major transformations, no aggregations, just a simple copy with the aforementioned lookups into the EAV tables.Drew
I just deployed a 14000 line update statement. The code needed to update a project code, which is some strange alpha-numeric string that is generated. We needed to take the first 2 characters, insert a !, and add another character at the end.
Maybe a 10 line case statement would have done it.
The developer did a select *, copied all 14 K records into a spreadsheet, and manually added the chars in the right place.
He then copied and pasted that into a query window, and added the update...set...where to all 14k lines.
This is a senior level person who has been in IT for 30 years.
Michael L John
If you assassinate a DBA, would you pull a trigger?
To properly post on a forum:
http://www.sqlservercentral.com/articles/61537/
September 13, 2018 at 8:05 pm
Sean Lange - Thursday, September 13, 2018 1:25 PMZZartin - Thursday, September 13, 2018 12:10 PMJeff Moden - Thursday, September 13, 2018 8:23 AMShifting gears to TRY/CATCH, I think that the way a lot of people use it is wrong, especially in the presence of SET XACT_ABORT ON. Might be worth an article someday.The biggest problem i see people doing with TRY/CATCH and this isn't just in SQL Server is that people use it to do exactly what the guy in that post was doing. No attempt at pre parsing or correcting errors, just throw a bunch of stuff into it and see if it sticks. Which isn't so much an issue with TRY/CATCH itself, used properly it's very powerful and useful, it just enables some very lazy design practices.
Far too often it gets turned into a TRY/SQUELCH instead. They use crappy code to swallow errors.
Guess I don't need to follow up much because the words, TRY/SQUELCH describe the problem perfectly. It's usually better to just SET XACT_ABORT ON and let SQL Server report the errors like it always has.
--Jeff Moden
Change is inevitable... Change for the better is not.
September 13, 2018 at 8:09 pm
Michael L John - Thursday, September 13, 2018 2:42 PMI just deployed a 14000 line update statement. The code needed to update a project code, which is some strange alpha-numeric string that is generated. We needed to take the first 2 characters, insert a !, and add another character at the end.
Maybe a 10 line case statement would have done it.
The developer did a select *, copied all 14 K records into a spreadsheet, and manually added the chars in the right place.
He then copied and pasted that into a query window, and added the update...set...where to all 14k lines.This is a senior level person who has been in IT for 30 years.
Heh... must be one of those people that think that "Just because you can do something in SQL Server, doesn't mean you should". :D:D:D
--Jeff Moden
Change is inevitable... Change for the better is not.
September 13, 2018 at 8:13 pm
drew.allen - Thursday, September 13, 2018 2:32 PMJeff Moden - Thursday, September 13, 2018 11:57 AMdrew.allen - Thursday, September 13, 2018 11:44 AMOMG. I'm working on a stored procedure that references an EAV table and it has 73 separate subqueries in a single SELECT statement to pull values out of the EAV table. And that's only the most egregious example. It also references a couple of other EAV tables.Drew
But it's fast, right? :D:D:D
It took almost 16 minutes to copy about 80K records from one database to another on the same server, so at least it's faster than molasses in January. There are no major transformations, no aggregations, just a simple copy with the aforementioned lookups into the EAV tables.
Drew
See? Told ya it was fast. :D:D:D
--Jeff Moden
Change is inevitable... Change for the better is not.
September 13, 2018 at 10:45 pm
andycadley - Thursday, September 13, 2018 12:53 AMThere is clearly still a long road to go before people default to learning the basics of structured programming before hacking the living daylights out of process flow with gotos.
Nah, there is no any road ahead.
Educated staff always costs more, and management always opt for a cheaper option.
They don't know much about structured programming, so the only criteria for them is the rate.
And you know what?
For a normal manager having 3 lousy develpers is better than one highly advanced.
It's in their rule book.
_____________
Code for TallyGenerator
September 13, 2018 at 10:56 pm
ZZartin - Thursday, September 13, 2018 12:10 PMJeff Moden - Thursday, September 13, 2018 8:23 AMShifting gears to TRY/CATCH, I think that the way a lot of people use it is wrong, especially in the presence of SET XACT_ABORT ON. Might be worth an article someday.The biggest problem i see people doing with TRY/CATCH and this isn't just in SQL Server is that people use it to do exactly what the guy in that post was doing. No attempt at pre parsing or correcting errors, just throw a bunch of stuff into it and see if it sticks. Which isn't so much an issue with TRY/CATCH itself, used properly it's very powerful and useful, it just enables some very lazy design practices.
It's eqally true about pretty much every new feature in SQL Server introduces since 2005.
They all are meant to make life easier for those who are not good with relational databases, paving the way for most horrible database solutions.
P.S.
When I saw "IIF" function I knew - it's the final nail onto the coffin of SQL Server.
_____________
Code for TallyGenerator
September 14, 2018 at 4:33 am
Sergiy - Wednesday, September 12, 2018 7:50 PMBrandie Tarvin - Wednesday, September 12, 2018 8:53 AMjasona.work - Wednesday, September 12, 2018 8:44 AMOne of these days, I'm going to break down and try JD...
Just to see what all the fuss is about (I don't drink so...)If you don't drink because, like me, you don't like the taste of alcohol, don't bother. It's nothing much.
If you don't drink because of other reasons, then maybe you will like the taste of it. @=)
Taste of alcohol hugely depends on perception.
As they say, to pessimists cognac smells like bedbugs, to optimists bedbugs smell like cognac.
Alcohol literally tastes like poison to me, mostly. I can occasionally drink something fruity if it has maybe half or less of the usual amount of alcohol (like a mixed drink). But if it has more than that, I can't get past one sip.
EDIT: Clarification. Sometimes I like a shot of sweet sake, plum wine, pear port, or ice wine. But I can't drink more than that because then my tongue starts noticing the burn.
September 14, 2018 at 4:38 am
Michael L John - Thursday, September 13, 2018 2:42 PMI just deployed a 14000 line update statement. The code needed to update a project code, which is some strange alpha-numeric string that is generated. We needed to take the first 2 characters, insert a !, and add another character at the end.
Maybe a 10 line case statement would have done it.
The developer did a select *, copied all 14 K records into a spreadsheet, and manually added the chars in the right place.
He then copied and pasted that into a query window, and added the update...set...where to all 14k lines.This is a senior level person who has been in IT for 30 years.
Quit lookin' at my code!
@=)
Actually, that sounds like someone who grew up working on the old database software and just hasn't gotten out of the habit as relational databases evolved.
September 14, 2018 at 5:16 am
I think we need to add some balance here. I like drinking beer, and lots of it.
Luckily, today is Friday and I will get the chance to assuage my thirst.
September 14, 2018 at 5:23 am
Phil Parkin - Friday, September 14, 2018 5:16 AMI think we need to add some balance here. I like drinking beer, and lots of it.
Luckily, today is Friday and I will get the chance to assuage my thirst.
I've got some nice Italian red wine in the car for tonight.
Tomorrow's a beer day. We're off to a local music festival and they have their own ales brewed for the weekend. It's a shame the weather's not looking great. I suppose if it's too bad we can go and hide in the pub.
How to post a question to get the most help http://www.sqlservercentral.com/articles/Best+Practices/61537
September 14, 2018 at 5:30 am
Neil Burton - Friday, September 14, 2018 5:23 AMPhil Parkin - Friday, September 14, 2018 5:16 AMI think we need to add some balance here. I like drinking beer, and lots of it.
Luckily, today is Friday and I will get the chance to assuage my thirst.I've got some nice Italian red wine in the car for tonight.
Tomorrow's a beer day. We're off to a local music festival and they have their own ales brewed for the weekend. It's a shame the weather's not looking great. I suppose if it's too bad we can go and hide in the pub.
'Hiding' in the pub while it's wazzing down outside is actually rather a pleasant pastime. The incessant rain removes some of the guilt sometimes associated with remaining largely immobile and slumped against the bar for seven or eight hours: "We can't go out in this! Whose round is it, anyway?"
September 14, 2018 at 5:39 am
Sergiy - Thursday, September 13, 2018 10:56 PMIt's eqally true about pretty much every new feature in SQL Server introduces since 2005.
They all are meant to make life easier for those who are not good with relational databases, paving the way for most horrible database solutions.
P.S.
When I saw "IIF" function I knew - it's the final nail onto the coffin of SQL Server.
I agree, we should all default to REVERSE STRING RIGHT again, and before I could carry on to rant about this, I'll leave it as it stands. Probably you have never seen any use for geospatial data either.
September 14, 2018 at 7:09 am
Phil Parkin - Friday, September 14, 2018 5:16 AMI think we need to add some balance here. I like drinking beer, and lots of it.
Luckily, today is Friday and I will get the chance to assuage my thirst.
I'm right there with you Phil. Luckily my band is playing a gig tonight so plenty of beers are in my future.
_______________________________________________________________
Need help? Help us help you.
Read the article at http://www.sqlservercentral.com/articles/Best+Practices/61537/ for best practices on asking questions.
Need to split a string? Try Jeff Modens splitter http://www.sqlservercentral.com/articles/Tally+Table/72993/.
Cross Tabs and Pivots, Part 1 – Converting Rows to Columns - http://www.sqlservercentral.com/articles/T-SQL/63681/
Cross Tabs and Pivots, Part 2 - Dynamic Cross Tabs - http://www.sqlservercentral.com/articles/Crosstab/65048/
Understanding and Using APPLY (Part 1) - http://www.sqlservercentral.com/articles/APPLY/69953/
Understanding and Using APPLY (Part 2) - http://www.sqlservercentral.com/articles/APPLY/69954/
September 14, 2018 at 7:46 am
DinoRS - Friday, September 14, 2018 5:39 AMProbably you have never seen any use for geospatial data either.
Name it.
_____________
Code for TallyGenerator
Viewing 15 posts - 62,221 through 62,235 (of 66,815 total)
You must be logged in to reply to this topic. Login to reply