October 20, 2017 at 10:49 am
Hugo Kornelis - Friday, October 20, 2017 4:55 AMSean Lange - Thursday, October 19, 2017 3:30 PMOh how I love third party databases. I have been working with this one off and on and am always surprised that the table I am looking at doesn't have a primary key so just for giggles I ran these two queries.
select count(*) from sys.tables
select count(*) from sys.indexes where type_desc = 'HEAP'tables = 495
heaps = 433And people wonder why this system is so slow. :crying:
Nitpicking, I know - but a primary key can also be implemented with a nonclustered index. So in theory (and I am really talking theory here) it is still possible that all those 433 have a nice nonclustered primary key on them.... :crazy:
Theory? I'm sure you saw our tables.
October 20, 2017 at 10:54 am
Luis Cazares - Friday, October 20, 2017 10:49 AMHugo Kornelis - Friday, October 20, 2017 4:55 AMSean Lange - Thursday, October 19, 2017 3:30 PMOh how I love third party databases. I have been working with this one off and on and am always surprised that the table I am looking at doesn't have a primary key so just for giggles I ran these two queries.
select count(*) from sys.tables
select count(*) from sys.indexes where type_desc = 'HEAP'tables = 495
heaps = 433And people wonder why this system is so slow. :crying:
Nitpicking, I know - but a primary key can also be implemented with a nonclustered index. So in theory (and I am really talking theory here) it is still possible that all those 433 have a nice nonclustered primary key on them.... :crazy:
Theory? I'm sure you saw our tables.
Heh I knew on this system those guys weren't that "clever". I have used the front end and it is bad enough, the backend is truly scary.
_______________________________________________________________
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/
October 21, 2017 at 2:06 pm
Still here I see.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 22, 2017 at 10:02 am
Grant Fritchey - Saturday, October 21, 2017 2:06 PMStill here I see.
Where else would we be?
Thomas Rushton
blog: https://thelonedba.wordpress.com
October 23, 2017 at 5:19 am
ThomasRushton - Sunday, October 22, 2017 10:02 AMGrant Fritchey - Saturday, October 21, 2017 2:06 PMStill here I see.Where else would we be?
We all might've moved over to StackOverflow, or maybe /r/DBA...
October 23, 2017 at 6:40 am
jasona.work - Monday, October 23, 2017 5:19 AMThomasRushton - Sunday, October 22, 2017 10:02 AMGrant Fritchey - Saturday, October 21, 2017 2:06 PMStill here I see.Where else would we be?
We all might've moved over to StackOverflow, or maybe /r/DBA...
Not much chance of that.
October 23, 2017 at 4:04 pm
Grant Fritchey - Saturday, October 21, 2017 2:06 PMStill here I see.
Does this mean that you are back from your sabbatical?
What all did you do?
Wayne
Microsoft Certified Master: SQL Server 2008
Author - SQL Server T-SQL Recipes
October 23, 2017 at 5:11 pm
WayneS - Monday, October 23, 2017 4:04 PMGrant Fritchey - Saturday, October 21, 2017 2:06 PMStill here I see.Does this mean that you are back from your sabbatical?
What all did you do?
I am back and on the road to Connections. I'll see you at Summit next week I hope.
Tons of stuff. #1 was three weeks in Germany.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 23, 2017 at 5:35 pm
Grant Fritchey - Monday, October 23, 2017 5:11 PMWayneS - Monday, October 23, 2017 4:04 PMGrant Fritchey - Saturday, October 21, 2017 2:06 PMStill here I see.Does this mean that you are back from your sabbatical?
What all did you do?
I am back and on the road to Connections. I'll see you at Summit next week I hope.
Tons of stuff. #1 was three weeks in Germany.
Nice. Do you feel refreshed and inspired, like you're just back from sabbatical?
The real question, of course, is about how many emails you had in your inbox. 😛
I know when I take any time off at all, my inbox blows up. It's almost like when sharks smell blood in the water get into a frenzy. It causes people to send more email asking why I haven't responded to their email. The OOO was clearly not enough so they have to send more email.
October 24, 2017 at 6:39 am
Ed Wagner - Monday, October 23, 2017 5:35 PMNice. Do you feel refreshed and inspired, like you're just back from sabbatical?
The real question, of course, is about how many emails you had in your inbox. 😛I know when I take any time off at all, my inbox blows up. It's almost like when sharks smell blood in the water get into a frenzy. It causes people to send more email asking why I haven't responded to their email. The OOO was clearly not enough so they have to send more email.
I had an auto-delete on everything for my work email along with a message saying it was getting nuked. Ha!
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
October 24, 2017 at 7:43 am
Grant Fritchey - Tuesday, October 24, 2017 6:39 AMEd Wagner - Monday, October 23, 2017 5:35 PMNice. Do you feel refreshed and inspired, like you're just back from sabbatical?
The real question, of course, is about how many emails you had in your inbox. 😛I know when I take any time off at all, my inbox blows up. It's almost like when sharks smell blood in the water get into a frenzy. It causes people to send more email asking why I haven't responded to their email. The OOO was clearly not enough so they have to send more email.
I had an auto-delete on everything for my work email along with a message saying it was getting nuked. Ha!
SPOM! ROFLMAO! I was sure that I was the only one that ever did such a thing. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
October 24, 2017 at 3:57 pm
Looks like a Son of Silver Spoon has disappeared because he didn't get the answers to both questions. Not getting any response today.
October 24, 2017 at 4:54 pm
Jeff Moden - Tuesday, October 24, 2017 7:42 AMGrant Fritchey - Tuesday, October 24, 2017 6:39 AMI had an auto-delete on everything for my work email along with a message saying it was getting nuked. Ha!
SPOM! ROFLMAO! I was sure that I was the only one that ever did such a thing. 😀
I used to do this periodically with the pile on my desk. People would drop work off, or I'd print emails. Once it got more than an inch or so thick, I'd throw everything below the top few items in the trash. Clearly I was never going to pop that work off the stack.
October 25, 2017 at 2:20 am
So, several years ago a contractor wrote a rather involved 'temporary' query against a third-party database that we have no control over - and of course it is still in use today. There is a bug in said query and I was asked to look at it several months ago, whenever I had nothing better to do.
The third-party database has no foreign keys, no documentation, no constraints and inconsistent column names (columns that have the same information/purpose in different tables may not have the same, or similar names). All of the logic appears to be in the front end, and the third-party isn't sharing that.
This hasn't been my favourite task and until recently I was having no success at all. With the help of one of the developers on my team (whom I would put up against all of the third-party's bunch) I have had an epiphany and I can see the cause of the bug.
We use SQL 2012 and I have written a wonderful and simple piece of code, using LEAD and LAG, to correct the data. I can insert it into the original code without interfering with any of the logic already there.
It is a thing of beauty and I feel sufficiently smug.
And then I realise they have their database on 2008.
Yes, I should have checked and probably did way back when I first looked, but moved some of the data onto my servers and promptly forgot.
I need a word to describe this feeling - I've run out of expletives (and I know quite a few).
October 25, 2017 at 3:48 am
Steve, I feel your pain! Damn shame you can't use the windowing functions in 2008. I seem to use them more and more for simplifying problems.
I had the complete opposite situation last year at a company. Most of the dbs were 2008 R2, but one was 2012 or 2014. My fellow Dev had a nasty little task set which using FIRST_VALUE was trivial to do. But he wasn't too familiar with windowing functions. I spotted the server was 2012 (or 2014) gave him the solution the next morning... Worked like a dream.
Except, all the overnight build was run via third party app that had its own t-sql interpreter (yep no SSIS here or sql jobs running T-sql) and it was only up to 2008...
"It doesn't work for the over night build" I was told the day after...
"Oh I reply, why not stick the code in a stored procedure and call that from the build job..."
Result. I had to say I was really glad it did, tricky to solve without FIRST_VALUE ! I would have had to post the problem on the forums 🙂
Rodders...
Edit: It was FIRST_VALUE not LEAD that saved the day!
Viewing 15 posts - 60,181 through 60,195 (of 66,738 total)
You must be logged in to reply to this topic. Login to reply