Viewing 15 posts - 481 through 495 (of 5,841 total)
alex.sqldba (1/5/2017)
I suspect the answer to my question will be along the lines of YMMV, but I'll ask it anyway 🙂
When looking through some execution plans earlier for some...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 5, 2017 at 9:09 am
Jeff Moden (1/5/2017)
Why not just replace the embedded carriage returns with an empty string?
This gets my vote. Fix the data before or during load into SQL Server.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 5, 2017 at 8:53 am
lmarkum (1/5/2017)
TheSQLGuru (1/3/2017)
2) You should have some explicit error...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 5, 2017 at 8:49 am
Lots of issues/questions here
1) You cannot do an average of an average, which it seems you are asking for.
2) You want Adam 1 through Adam 5 combined. What rules allow...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 4, 2017 at 9:55 am
1) You have extra BEGIN TRAN's in the sproc. You should just have one at the very top and the very bottom.
2) You should have some explicit error checking in...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 3, 2017 at 9:59 am
With your requirements amendment I think Drew's modification to my query should get you what you want.
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 3, 2017 at 9:47 am
TheSQLGuru (1/3/2017)
It would be helpful to have sample data and expected output. But I am thinking something like this:select year(awarddate), employeeid, min(awarddate)
from sometable
where awardflag = 1
group by awarddate, employeeid
I should...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 3, 2017 at 9:08 am
It would be helpful to have sample data and expected output. But I am thinking something like this:
select year(awarddate), employeeid, min(awarddate)
from sometable
where awardflag = 1
group by awarddate, employeeid
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 3, 2017 at 8:40 am
I had a really awesome reply almost finished last night, with sample scripts and data and plan analysis. I couldn't finish it before going to bed though and when I...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 2, 2017 at 8:25 am
Here is another solution. I didn't benchmark this solution against the million row table, but I expect it to perform more efficiently based on simplicity even if the POC index...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 1, 2017 at 11:25 am
Sergiy (1/1/2017)
Every index has statistics on it, and statistics could suggest optimiser that the date selection is ultimately selective.
I'm sorry Sergiy, but that is absolutely not the case. The optimizer...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
January 1, 2017 at 9:32 am
Jeff:
"If the NCI had a leading column of the TrackingNumber and there's only one of each tracking number in the table, how do you figure that would result in a...
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
December 31, 2016 at 6:06 pm
Jeff Moden (12/30/2016)
TheSQLGuru (12/30/2016)
Jeff Moden (12/30/2016)
TheSQLGuru (12/30/2016)
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
December 31, 2016 at 9:05 am
lmarkum (12/30/2016)
TheSQLGuru (12/30/2016)
lmarkum (12/30/2016)
Sergiy (12/30/2016)
lmarkum (12/23/2016)
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
December 31, 2016 at 9:02 am
lmarkum (12/30/2016)
Sergiy (12/30/2016)
lmarkum (12/23/2016)
Best,
Kevin G. Boles
SQL Server Consultant
SQL MVP 2007-2012
TheSQLGuru on googles mail service
December 30, 2016 at 4:30 pm
Viewing 15 posts - 481 through 495 (of 5,841 total)