Forum Replies Created

Viewing 15 posts - 4,621 through 4,635 (of 7,613 total)

  • RE: Temp table

    I don't think a global temp table would necessarily be immediately dropped. But overall I agree, there's no great concern to drop temp tables in the code, unless perhaps:

    1)...

    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: Where clause prevents index seek

    That's extremely bizarre. They can just do:

    WHERE pk = '10000'

    and if pk is a numeric type, SQL will convert the 10000 to that type and be able to do...

    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: Partitioned Aligned Indexes & Primary Key

    I'm not talking about partitioning, I'm talking about index tuning, particularly first selecting the best clustered index. Most tables don't really need partitioned. I partition mainly to allow...

    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: Partitioned Aligned Indexes & Primary Key

    You could also archive first and modify the indexes later.

    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: Partitioned Aligned Indexes & Primary Key

    The main thing is to make sure the tables are properly clustered. Often that will give you good performance from the table even without archiving (or partitioning).

    Partitioning is sometimes...

    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: Tune SQL Query with very large tables

    --!!NOTE: showing missing indexes can take some time; set @list_missing_indexes = 0 below if you don't want to wait!!

    --USE [your_db_name]

    SET DEADLOCK_PRIORITY -8 --make sure we are the victim if we...

    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: Tune SQL Query with very large tables

    Would need to see the view definition and related table definitions.

    If you're serious about tuning the tables, rather than just this specific query, would also need to see...

    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: What happens with uncommitted transactions?

    First, let's clear this up:

    Is it only the user account of the one who made the [transaction], who gets [blocked]?

    Absolutely not. SQL doesn't care at all about who did...

    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: Query Performance Problem

    Sergiy (11/19/2015)


    ScottPletcher (11/19/2015)


    I'm certain they're never running an EXISTS check because they are not reusing codes,

    Have a look at the topic starter:

    SET @RedemptionCode = dbo.GenerateRandomBase32(@RedemptionSeed)

    WHILE((@RedemptionCode IS NULL) OR EXISTS(SELECT RedemptionCode...

    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: Query Performance Problem

    Sergiy (11/19/2015)


    ScottPletcher (11/19/2015)


    When one campaign is over all the relevant promo codes are made inactive.

    Yes, by deleting them from the current promo table, not by just flagging them. They...

    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: Unique index on varchar(max) column

    To have the index automatically built, you can add a persisted, computed column, like this:

    CREATE TABLE search_T

    (

    num INT,

    value VARCHAR(max),

    value_for_indexing as cast(left(value,896) as varchar(896)) persisted

    ,UNIQUE CLUSTERED (num,value_for_indexing)

    )

    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: Query Performance Problem

    Sergiy (11/19/2015)


    ScottPletcher (11/19/2015)


    Try to follow this, it's simple enough even for you.

    When it's used up initially, it's removed forever from the current table, since it has no current value.

    No person...

    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: Query Performance Problem

    Sergiy (11/19/2015)


    ScottPletcher (11/19/2015)


    Sergiy (11/19/2015)

    ScottPletcher (11/18/2015)


    Once they've been used up, you'd remove them so they can't be reused.

    How exactly you intend to prevent used codes from being reused (regenerated as new)...

    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: Query Performance Problem

    Sergiy (11/19/2015)

    ScottPletcher (11/18/2015)


    Once they've been used up, you'd remove them so they can't be reused.

    How exactly you intend to prevent used codes from being reused (regenerated as new) if they...

    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: Query Performance Problem

    Sergiy (11/18/2015)


    ScottPletcher (11/18/2015)


    Once they've been used up, you'd remove them so they can't be reused.

    How exactly you intend to prevent used codes from being reused (regenerated as new) if they...

    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 - 4,621 through 4,635 (of 7,613 total)