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.
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.