Forum Replies Created

Viewing 15 posts - 3,256 through 3,270 (of 7,615 total)

  • RE: How to Get Peformance Counters Programmatically for One Dynamic SQL Statement

    Consider using system views such as sys.dm_db_index_operational_stats. Presumably you know at least the db(s) in which the code operates, although hopefully object names as well (or at least most...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Keep only the true changes in a massive table

    Wouldn't you want to do that the other way?  That is, find rows where the previous row matches the next row -- i.e. no column changed -- so you could...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Seeking advice to determine a good option for table row comparisons

    Use MS's free tool "tablediff.exe" and let them do this work for you, and fully tested already!  Unfortunately quirky to get working initially, but works well after that, and it's...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Sorting and Grouping problem

    I didn't have any data to test with, but I'm reasonably sure my sort order is correct.  As I think you've since discovered, the rows get out of order outside...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Sorting and Grouping problem


    ;WITH cte_EarliestShowDates AS (
      SELECT Show, MIN(Date) AS EarliestShowDate
      FROM dbo.TableName
      GROUP BY Show
    )
    SELECT TN.*
    FROM dbo.TableName TN
    INNER JOIN cte_EarliestShowDates CESD...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: How to improve Delete Performance

    quinn.jay - Tuesday, July 17, 2018 12:43 PM

    I ended up going with a tweak on the DELETE statement coupled with clustered and...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: How to improve Delete Performance

    right now deletes the current and previous month, where the table holds 2.5 yrs of data. These tables currently do not have any keys, constraints o[r] indexes. 

    Cluster...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: DBCC Shrinkfile not shrinking Data File

    When you add the keyword, you're probably preventing the physical shrinking.  If you really want to shrink, just shrink:

    DBCC SHRINKFILE (N'prod1', 0)

    I wouldn't use 0 personally...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Left(null,5) 'anything' is not true?

    set ansi_nulls off 
    I'm trying to find a way to avoid having to use isnull() or coalesce() everywhere in my script in order to avoid counterintuitive null comparison results...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Accurate Estimations, But Hash Match Aggregate Spilling to TempDB

    chris.o.smith - Monday, July 16, 2018 7:23 AM

    Thanks for the responses, and sorry for the delay - the responses came in...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Validate whether at least 1 record per user is marked as primary

    I swear I posted this already (somewhere at least!, another SQL help site perhaps?), but I'll post it here too just in case:


    SELECT EmployeeInformationID, COUNT(*)...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Joining on the numeric part of string...

    daniness - Thursday, July 12, 2018 12:37 PM

    Thanks for all of your input, folks.

    @ScottPletcher , I'm able to somewhat understand your solution,...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: sql cursor in stored procedure - not looping

    sgmunson - Thursday, July 12, 2018 12:06 PM

    sani.bozic - Thursday, July 12, 2018 9:28 AM

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: sql cursor in stored procedure - not looping

    Although not considered "standard", I prefer this approach because (1) the FETCH only has to be written once (can't count the number of times someone changes only one FETCH when...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

  • RE: Can I Proper case a UK address string with postcode with a function

    Rather than repeatedly having to identity the post code, add an AFTER INSERT, UPDATE trigger that finds the post code and then store its byte location and length in a...

    SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".

Viewing 15 posts - 3,256 through 3,270 (of 7,615 total)