November 10, 2018 at 7:05 am
WayneS - Friday, November 9, 2018 11:50 PMLynn Pettis - Friday, November 9, 2018 3:19 PMLynn Pettis - Friday, November 9, 2018 2:39 PMHow about that the SQL Engine continues search for additional matches on a PRIMARY KEY after it finds it to see if there are other matches. (head meet desk)OMG! More...
Link please? This sounds too good to pass up... at least to read!
Lynn Pettis - Friday, November 9, 2018 3:19 PMLynn Pettis - Friday, November 9, 2018 2:39 PMHow about that the SQL Engine continues search for additional matches on a PRIMARY KEY after it finds it to see if there are other matches. (head meet desk)OMG! More...
Do you have a link or demonstrable code for that Lynn? I've never seen such a thing unless the criteria is non-SARGable or the optimizer correctly decides that a scan would be better.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 10, 2018 at 8:09 am
Jeff Moden - Saturday, November 10, 2018 7:05 AMLynn Pettis - Friday, November 9, 2018 3:19 PMLynn Pettis - Friday, November 9, 2018 2:39 PMHow about that the SQL Engine continues search for additional matches on a PRIMARY KEY after it finds it to see if there are other matches. (head meet desk)OMG! More...
Do you have a link or demonstrable code for that Lynn? I've never seen such a thing unless the criteria is non-SARGable or the optimizer correctly decides that a scan would be better.
Lynn is referring to this post https://www.sqlservercentral.com/Forums/Dialogs/PostDetails.aspx?PostID=2009398
November 10, 2018 at 9:40 am
Lynn Pettis - Wednesday, October 31, 2018 2:52 PMGrant Fritchey - Wednesday, October 31, 2018 2:36 PMLynn Pettis - Wednesday, October 31, 2018 1:30 PMThis is a rant, too be honest. Other than syntactical differences, what is different between the following two queries:
select
[a].[co_num]
, .[cust_po]
, [a].[co_line]
, [a].[co_release]
, [a].[item]
, [a].[u_m]
, [a].[qty-ordered]
, [a].[whse]
, .[cust_seq]
, .[ship_code]
from
[10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
left outer join [10.1.10.140\EES_LIVE].[ESS_app].[dbo].[co] as
on [a].[co_num] = .[co_num]
where
[a].[co_num] not like '%q0%'
and [a].[co_line] = 1
order by
[a].[co_num] desc;
goselect
[a].[co_num]
, .[cust_po]
, [a].[co_line]
, [a].[co_release]
, [a].[item]
, [a].[u_m]
, [a].[qty-ordered]
, [a].[whse]
, .[cust_seq]
, .[ship_code]
from
[10.1.10.140\EES_LIVE].[ESS_app].[dbo].[coitem] as [a]
left join [ESS_app].[dbo].[co] as
on [a].[co_num] = .[co_num]
where
[a].[co_num] not like '%q0%'
and [a].[co_line] = 1
order by
[a].[co_num] desc;
goBoth have horrifying naming standards that will lead to confusion as more tables get introduced and or various different tables are named [a] or . Other than that, the four part name.
For everyone, the second query didn't work but the first did. The OP couldn't see the difference either.
Not only that but totally agreed on the 4 part naming thing and the alias naming thing. It's not "bullet proof" because there will be an issue in the future when someone decides to change the IP address or instance name of the ESS box. Folks really shouldn't use 3 or 4 part naming in code. They should either be using synonyms or pass-through views. Heh... that would also allow one to get rid of the freakin' brackets in most places. 😀
Heh... of course, there's also the issue of criteria with a leading wild card and then using NOT on top of it all.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 10, 2018 at 2:43 pm
We started moving our data center last night at 3 am. 12 racks of servers, switches, San, etc. Anticipated finish time was 6 am. We (the network folks) are still connecting servers, configuring ports, and configuring firewalls.
This may be a resume generating event for some folks.
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/
November 10, 2018 at 10:00 pm
Michael L John - Saturday, November 10, 2018 2:43 PMWe started moving our data center last night at 3 am. 12 racks of servers, switches, San, etc. Anticipated finish time was 6 am. We (the network folks) are still connecting servers, configuring ports, and configuring firewalls.This may be a resume generating event for some folks.
Heh... Sounds like you may be right. I guess I don't understand why anyone in the right frame of mind would think that such a move could be done in 3 hours. How far did you have to move the data center?
--Jeff Moden
Change is inevitable... Change for the better is not.
November 11, 2018 at 12:37 pm
Jeff Moden - Saturday, November 10, 2018 10:00 PMMichael L John - Saturday, November 10, 2018 2:43 PMWe started moving our data center last night at 3 am. 12 racks of servers, switches, San, etc. Anticipated finish time was 6 am. We (the network folks) are still connecting servers, configuring ports, and configuring firewalls.This may be a resume generating event for some folks.Heh... Sounds like you may be right. I guess I don't understand why anyone in the right frame of mind would think that such a move could be done in 3 hours. How far did you have to move the data center?
About 5 miles. We finished just under 22 hours after we started. The entire project was a classic example of resources not being dedicated to a project of this magnitude. Everyone involved was still being pulled in 20 different directions to perform their "daily chores", while trying to plan and prepare for this move.
Guess what. Things got missed.
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/
November 11, 2018 at 1:26 pm
Michael L John - Sunday, November 11, 2018 12:37 PMAbout 5 miles. We finished just under 22 hours after we started. The entire project was a classic example of resources not being dedicated to a project of this magnitude. Everyone involved was still being pulled in 20 different directions to perform their "daily chores", while trying to plan and prepare for this move.
Guess what. Things got missed.
That's what we did (about 5 miles). We had about 18 racks. From the word "GO" on a Friday night, we worked straight through 'til just before the bell rang on Monday morning. It took more than 3 hours just to de-cable the racks and remove the equipment from the racks.
--Jeff Moden
Change is inevitable... Change for the better is not.
November 11, 2018 at 5:16 pm
Jeff Moden - Saturday, November 10, 2018 9:40 AMNot only that but totally agreed on the 4 part naming thing and the alias naming thing. It's not "bullet proof" because there will be an issue in the future when someone decides to change the IP address or instance name of the ESS box. Folks really shouldn't use 3 or 4 part naming in code. They should either be using synonyms or pass-through views. Heh... that would also allow one to get rid of the freakin' brackets in most places. 😀
Heh... of course, there's also the issue of criteria with a leading wild card and then using NOT on top of it all.
I started putting brackets out of self defense, especially in my dynamic SQL as ID 10 T's have broken working code by doing really stupid stuff in production databases regarding names of database objects, like index names.
November 12, 2018 at 5:24 am
Lynn Pettis - Sunday, November 11, 2018 5:16 PMI started putting brackets out of self defense, especially in my dynamic SQL as ID 10 T's have broken working code by doing really stupid stuff in production databases regarding names of database objects, like index names.
Heh... there IS that problem. Ironically, that's a part of the reason I don't use brackets. I'm usually able to figure out "whodunit" and have a pork chop dinner with them. 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
November 12, 2018 at 5:34 am
Jeff Moden - Monday, November 12, 2018 5:24 AMLynn Pettis - Sunday, November 11, 2018 5:16 PMI started putting brackets out of self defense, especially in my dynamic SQL as ID 10 T's have broken working code by doing really stupid stuff in production databases regarding names of database objects, like index names.Heh... there IS that problem. Ironically, that's a part of the reason I don't use brackets. I'm usually able to figure out "whodunit" and have a pork chop dinner with them. 😀
As I've just found a database whose filenames (logical & physical) begin with a space but the DBName doesn't, I'm going with Lynn here...
Thomas Rushton
blog: https://thelonedba.wordpress.com
November 12, 2018 at 6:26 am
ThomasRushton - Monday, November 12, 2018 5:34 AMAs I've just found a database whose filenames (logical & physical) begin with a space but the DBName doesn't, I'm going with Lynn here...
You should go with me. It's much more fun to find and pork chop the perpetrator(s). 😀
--Jeff Moden
Change is inevitable... Change for the better is not.
November 12, 2018 at 6:30 am
Jeff Moden - Monday, November 12, 2018 6:26 AMYou should go with me. It's much more fun to find and pork chop the perpetrator(s). 😀
Sounds like a waste of good pork...
...which reminds me. I need to get some bacon for tomorrow's breakfast.
Thomas Rushton
blog: https://thelonedba.wordpress.com
November 12, 2018 at 6:35 am
ThomasRushton - Monday, November 12, 2018 5:34 AMAs I've just found a database whose filenames (logical & physical) begin with a space but the DBName doesn't, I'm going with Lynn here...
I've got a few databases at work with the database name created in this pattern: c:\directory\subdirectory\filename.mdf.
So to make a valid backup brackets would be used, the backup then looks like:
backup database [c:\directory\subdirectory\filename.mdf] to 'another path here' etc. I was a bit confused when I first ran across this thing, the working theory is that this was installed by some vendor support tech who was filling out forms one of which inquired of the database name and that's what he entered and I guess it makes sense in a "don't want to enter the wrong name" sort of way.
November 12, 2018 at 7:20 am
patrickmcginnis59 10839 - Monday, November 12, 2018 6:35 AMI've got a few databases at work with the database name created in this pattern: c:\directory\subdirectory\filename.mdf.
So to make a valid backup brackets would be used, the backup then looks like:backup database [c:\directory\subdirectory\filename.mdf] to 'another path here' etc. I was a bit confused when I first ran across this thing, the working theory is that this was installed by some vendor support tech who was filling out forms one of which inquired of the database name and that's what he entered and I guess it makes sense in a "don't want to enter the wrong name" sort of way.
Yowch!
--Jeff Moden
Change is inevitable... Change for the better is not.
November 12, 2018 at 11:31 am
Jeff Moden - Saturday, November 10, 2018 10:00 PMMichael L John - Saturday, November 10, 2018 2:43 PMWe started moving our data center last night at 3 am. 12 racks of servers, switches, San, etc. Anticipated finish time was 6 am. We (the network folks) are still connecting servers, configuring ports, and configuring firewalls.This may be a resume generating event for some folks.Heh... Sounds like you may be right. I guess I don't understand why anyone in the right frame of mind would think that such a move could be done in 3 hours. How far did you have to move the data center?
I think the only way you could move a datacenter in 3 hours without missing anything would be if it were one of these:
Bring in the flatbed trailer, winch it on once you've disconnected power and network, haul it to the new datacenter and drop it off the trailer, re-connect, then realize that some numpty forgot to secure ~1/2 the equipment to the racks and it's all now piled up on the floor...
OK, yeah, I guess you can't move a datacenter in 3hrs or less...
:hehe:
Viewing 15 posts - 62,821 through 62,835 (of 66,712 total)
You must be logged in to reply to this topic. Login to reply