Oooh great, this looks pretty good.
I've just given it a quick test. There are a couple of changes I need your help making but this is certainly most of the way there.
Couple of things I need:
Select the 'SaleOrder_Number' column from the SaleOrder entity, forgot about this.
Acknowledgements...
Hello All,
I'm looking for some help building a query which has currently got my head spinning right around.
I have several entities, these look something like this:
SaleOrder
--------
SaleOrder_ID
SaleOrderItem
-----------
SaleOrderItem_ID
SaleOrder_ID
Manufacturer_ID
Manufacturer...
Hello Guys,
I'm looking for some help on writing a query which is going to be used for populating an auto-suggest field for a list of customers.
The customer table which I'm querying has three fields which comprise the customers name.
Salutation
FirstName
LastName
The form the user fills in...
Hello Guys,
I have a query which looks something like this:
Select COUNT(SaleOrder_ID) AS ThisWeekByMemberCount
From SaleOrder
Where Placed IS NOT NULL
And Placed after start of current calendar week
Can someone help me complete the puzzle? I'm used to using DateAdd and could quite...
Hello Guys,
I'm looking for some help on this query:
Select Account_Type.Name,
Count(Account.Account_ID) As Accounts
From Account_Type
Left Outer Join Account On Account_Type.Account_Type_ID = Account.Account_Type_ID
Group By Account_Type.Name
This runs just fine and produces a fair...
Hey Guys,
Thanks a great deal for this, really excellent stuff. RiverGuy, your code seems to work sweet, I've tested plenty and it returns exactly as I would expect.
Thank you!
Heston
Hello Guys,
I have a scheduled script that runs every day and I want to pull a list of customers who should be billed on this day of the month.
Now, I've mocked up a little data to show you how I want this to work.
DECLARE @Customers TABLE (
Customer_ID int IDENTITY(1,1) NOT NULL...
Yeah, your code is a little more Verbose but like you say it gives you DROP STATISTICS/DROP INDEX dynamically which is a really nice touch, hence the purple star!
Cheers my man,
Heston
Hey George,
Thanks! I'll keep that code on file, I'm not sure if you spotted my post above, there is a link to a rather tidy solution to the problem!!
I appreciate your advice a great deal, as ever!
Heston *big wet kisses.
Haha well this is a problem I could really do with not having to deal with at this time of night :-)
Anyway, I've used this script in the end:
http://www.graytechnology.com/Blog/post.aspx?id=e21cbab0-8ae2-478e-a027-1b3b14e7d0b9
Quite similar to yours George, might be worth book marking for...
Ah ok, well that's very good to know! As I understand it I also have auto stats on so they'll be created. I'm not too worried about dropping them. However, what about the _dta_index doobies, any idea how to get rid of those?
Cheers mate, appreciate your advice a great deal.
Heston
Sorry George,
As a quick addition, in my statistics list (in the object explorer) there are also a load of entries for what I guess to be proposed indexes which look like '_dta_index_MessageLog_16_277576027__K7_K6_K3_K4' which don't appear to be grabbed by you query above, any ideas?
Cheers...
yeah, I'm a little anxious about it, is there any way to get a list of dates that statistics were created? this would help me confirm which were created in batch by dta and which were done intentionally.
Cheers, Heston.
George,
Thank you for your code, that'll help a great deal. I appreciate your concerns on dropping stats, it could be a real problem for me, thing is I'm having the issue described here:
Take a look here http://msdn.microsoft.com/en-us/library/ms190172.aspx
See, DTA has obviously crashed at...
Hello Guys,
I've been having this problem: http://www.tek-tips.com/viewthread.cfm?qid=1555259&page=1
Seems that DTA has crashed at some point and left lots (295) statistics on my database and it's causing problems :-)
I need a query which will delete all statistics from a table which are...
Ok, after looking at this a little more it seems these are all left from some database tuning advisor task which must have crashed out at some point, they're all prefixed with _dta_. I'll look at removing them.
Hmmm, after looking through the databases it seems that one of the tables has 299 statistics compared to all other tables which only seem to have maybe 4 or 5.
Even though this is a fairly high traffic table this to me would seem odd. I know very little about statistics, this would certainly...
Hello Guys,
Just wanted to run this past you as I have what I think to be odd behaviour on one of my maintenance tasks. The task does all the usual things created by the maintenance plan wizard on a handfull of databases, such as check integrity, rebuild indexes, reorganize indexes, shrink...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.