Forum Replies Created

Viewing 15 posts - 2,176 through 2,190 (of 7,619 total)

  • Reply To: Looking for ideal solution for nightly replication of database for reporting

    Here's a method I often use.  "Ideal", don't know.

    Use full backups and differentials.  Generally a differential restores very quickly (you can do the "base" restore of the full backup ahead...

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

  • Reply To: MAXDOP Setting

    If hyperthreading is present (most CPUs use this nowadays), set MAXDOP to no more than half the cores, in your case 4.

    If NUMA is being used, set it to no...

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

  • Reply To: Can we know the detailed information of a table ?

    SQL row/page compression is typically extremely helpful to reduce disk space.  Before SQL 2016, I believe you must have Enterprise Edition for it to be available.

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

  • Reply To: Can we know the detailed information of a table ?

    In the main table storage area, a row will be on one and only one page.  Any other data for that row must go to overflow pages.

    -1- There's not an...

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

  • Reply To: Trying to use rowversion (Timestamp) in SSIS as a for a high watermark

    You could try making the data type "rowversion" or "binary(8)" just to see if it works.

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

  • Reply To: UNION ALL Question

    Agreed, the best thing would be to review the query plan.  Even the estimated might give you some idea of the differences between the two queries.  To get the actual...

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

  • Reply To: Key locks on ghosted records

    rwest 44523 wrote:

    @ScottPetcher

    This is a READ COMMITTED transaction.  The lock should only be held for the duration of the statement, not the entire transaction.  So that doesn't seem to answer why...

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

  • Reply To: Key locks on ghosted records

    SQL probably takes the key lock before / as it's reading the row.  SQL's not taking a lock on a "row that doesn't exist", it's taking a lock on the...

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

  • Reply To: Changing datatype in a column

    Hmm.

    Presumably if SQL Server lets you alter the data type, then I would think the index should be good to go?!

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

  • Reply To: Could database with compat level 100 support columnstore index?

    Every db on an instance is upgraded internally to the current SQL version.  A backward compatibility level only affects certain things, not absolutely everything.  Thus, yes, it's possible that 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".

  • Reply To: Hello I need help to improove the following query with many joins

    I don't have time to attempt to consolidate the ExportSignal lookups right now.

    SELECT

    ISNULL(STA.STA_Manufacturer_Code, RDD.rdd_5) as 'Manufacturer Code',

    (

    SELECT TOP (1) ID2.Content FROM ItemMaster IM

    join ItemMasterDetail ID1 on IM.Id...

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

  • Reply To: Ugly code fix

    Jonathan AC Roberts wrote:

    jharvey6 76850 wrote:

    CASE
    WHEN Phone IS NOT NULL OR MobilPhone IS NOT NULL THEN
    CONCAT(CONCAT(LEFT(COALESCE(Phone,MobilPhone),3),'-'),
    CONCAT(CONCT(RIGHT(LEFT(COALESCE(Phone,MobilPhone),7),3),'-'),
    RIGHT(LEFT(COALESCE(Phone,MobilPhone),12),4)))
    ELSE ''
    END As PhoneNumber

    That's very odd code. It looks like whoever wrote it didn't know...

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

  • Reply To: Ugly code fix

    Maybe as below?  I've got a feeling CONCAT may be a bit slow, just like some of the other newer functions.  FORMAT is notoriously slow.

    CASE
    WHEN Phone IS...

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

  • Reply To: Numerous IF and Else clauses & its execution time in sys.dm_exec_procedure_stat

    The standard approach is to use ELSE to avoid unnecessary comparisons and show that only one path can be executed.  Something like:

    IF @param1 = 1 AND @param2...

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

  • Reply To: string selection

    SELECT
    FilePath,
    LEFT(FilePath, LEN(FilePath) - CHARINDEX('\', REVERSE(FilePath)))
    FROM #Path

    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 - 2,176 through 2,190 (of 7,619 total)