Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Search results for query: *

  1. HestonJames

    Entities which have relationship through one table but not another.

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

    Entities which have relationship through one table but not another.

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

    Auto-Suggest Query

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

    Query from beginning of this calendar week

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

    Count Join with Where

    Ah spot on guys! That makes perfect sense, I knew I was close and was confused as to what was going on! Thanks a great deal! Heston
  6. HestonJames

    Count Join with Where

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

    Last day of the month type question

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

    Last day of the month type question

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

    Update Statistics Takes AGES

    Solution to this problem can be found here: http://www.tek-tips.com/viewthread.cfm?qid=1555306&page=1 Heston
  10. HestonJames

    Query To Delete Statistics

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

    Query To Delete Statistics

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

    Query To Delete Statistics

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

    Query To Delete Statistics

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

    Query To Delete Statistics

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

    Query To Delete Statistics

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

    Query To Delete Statistics

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

    Query To Delete Statistics

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

    Update Statistics Takes AGES

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

    Update Statistics Takes AGES

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

    Update Statistics Takes AGES

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

Part and Inventory Search

Back
Top