Forum Replies Created

Viewing 15 posts - 3,046 through 3,060 (of 7,619 total)

  • RE: Advice on purging data

    aquanut - Monday, December 10, 2018 12:42 PM

    Hi Scott,

    I'd be concerned with staying within the maintenance window - steps 1 through...

    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: Advice on purging data

    Since you're only keeping ~1/6 of the data, you may want to consider a different approach.

    Backup up everything (of course!).  You might even want to make another copy...

    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 extract e specific data from a table

    Eirikur Eiriksson - Saturday, December 8, 2018 4:12 AM

    ScottPletcher - Friday, December 7, 2018 10:57 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: how to extract e specific data from a table


    SELECT [Product Line]
    FROM dbo.[Table]
    GROUP BY [Product Line]
    HAVING MAX(CASE WHEN [Business Unit] = '' THEN 1 ELSE 0 END) = 1 AND
        MAX(CASE...

    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: Clustered Index Scan vs Seek

    If there is any (non-filtered) index keyed first on id, then MAX(id) will do an index seek/lookup.  Internally it could officially be a scan, but it will be a scan...

    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: Trying ot understand how permission works when schedule a job through SQL Agent

    If the job owner has 'sa' level permissions, then the job is run under the Agent's service account, and thus using its permissions to other resources -- drives, network, etc..

    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: Is it possible to restore database with smaller size than source?

    I assume you have space in prod to restore the db to a diff name?

    If so, you could:

    1) restore the db to a diff name
    2)...

    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 performance question

    To avoid having to lookup every duplicate tab1.col1 value in tab2, which is pointless, I'd try this query:


    SELECT t1.col1
    FROM (
      SELECT DISTINCT col1...

    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: poor performing report query against table without a PK

    I don't see the non clustered index on OfferGenerateDate used, and do not understand why the clustered on OfferID is used.

    SQL has a very strong built-in preference...

    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: Issues with filling in the blanks from a calendar table.

    Some quick thoughts:

    1. Why not a 5-minute interval?  I don't know of anything other than a payment system that would need a lower interval than that.

    2....

    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: View that sums payments by person over a period of years

    Since you've very likely to (almost) always query by trans date, you should change the clustering on the table to:
    ( [transactionDate], [transactionId] )

    That will help performance for...

    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: poor performing report query against table without a PK

    ChrisM@Work - Tuesday, November 27, 2018 1:11 AM

    Create this index and check out the plan. I'd expect to see a seek for...

    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: If @@error not working with Insert statement

    Certain errors cause SQL to exit the batch, no matter what the code says.

    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 clean buffer cache without using DBCC command?

    You shouldn't really need to completely flush the buffers.  Comparing Logical I/O should be sufficient, since you can't really know what physical I/O will occur for any given query at...

    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: Need help

    But that doesn't match your original request.  You said you wanted "records" (i.e. rows), which would include the Due_time.

    If you need just the client_id and PU, you can...

    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,046 through 3,060 (of 7,619 total)