Forum Replies Created

Viewing 15 posts - 6,406 through 6,420 (of 7,619 total)

  • RE: Clustered Indexes on Identity columns

    Grant Fritchey (9/4/2013)


    ScottPletcher (9/4/2013)


    I admit, this is my pet peeve in physical table design. Identity as clus key is ridiculously over-, and, thus improperly, used. So I get...

    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 Indexes on Identity columns

    Grant Fritchey (9/4/2013)


    ScottPletcher (9/4/2013)


    Grant Fritchey (9/4/2013)

    Instead I've noticed that you're probably going to have an "identity more likely than not" approach on most systems just because it makes sense.

    I'd disagree...

    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 Indexes on Identity columns

    Grant Fritchey (9/4/2013)

    Instead I've noticed that you're probably going to have an "identity more likely than not" approach on most systems just because it makes sense.

    I'd disagree even with that;...

    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: Same query, two users, different performance

    Are schema names specified on the tables in the query? If not, what are the default schemas of the two users running the queries?

    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 Indexes on Identity columns

    @DaveDB:

    You're quite right. There's no genuinely good reason for the "default" clustering key to be an identity column. Many people just do it by rote, without thinking about...

    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: Help with query to get monthly data

    SELECT

    [Database],

    MAX(CASE WHEN MONTH(ReportDate) = 01 THEN Size END) AS Jan,

    MAX(CASE WHEN MONTH(ReportDate) = 02 THEN Size END) AS...

    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 to bypass via tsql a database when it is offline

    Patti Johnson (9/4/2013)


    Thank you so much for your help. I've been digging and digging so I appreciate your time.

    IF DATABASEPROPERTYEX('archer', 'Status') = 'ONLINE'

    AND EXISTS(SELECT 1 FROM sys.database_mirroring WHERE...

    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 to bypass via tsql a database when it is offline

    Patti Johnson (9/4/2013)


    I have added what was suggested:

    IF DATABASEPROPERTYEX('archer', 'Status') = 'ONLINE'

    BEGIN

    use archer

    SET NOCOUNT ON

    END

    It looks good until you execute and I...

    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 to bypass via tsql a database when it is offline

    Try this:

    IF DATABASEPROPERTYEX('archer', 'Status') = 'ONLINE'

    BEGIN

    ...

    END

    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: Dynamic SQL and DATEADD with User Defined Variable in Number/2nd position

    You don't want to use a function against the END_DATETIME column if you can avoid it, since any function will prevent SQL from using the full seek capabilities against that...

    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: Test and document recovery scenarios

    Don't forget restore damaged instance. That is the most complex recovery. Particularly test for master, model and msdb.

    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 Server Objects Naming Conventions

    Whatever rules you decide on, you should enforce them programmatically. Otherwise, the rules will be broken and be meaningless.

    Also, follow the first rule of naming -- don't build meaning...

    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: Condition requirement

    Something like below. It's possible you only need one left join, depending on the specific data in your tables:

    SELECT

    CASE WHEN b_out.Continent_cd IS NOT NULL THEN...

    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 there a way to improve this SELECT statement for performance?

    MyDoggieJessie (8/30/2013)


    ScottPletcher (8/30/2013)


    MyDoggieJessie (8/30/2013)


    It may "bypass" the locking of the records it's ready but it does not improve performance or reduce any overhead one bit.

    LOL. That's self-contradictory...

    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 there a way to improve this SELECT statement for performance?

    Sean Lange (8/30/2013)


    ScottPletcher (8/30/2013)


    Sean Lange (8/30/2013)


    ScottPletcher (8/30/2013)


    Sean Lange (8/30/2013)


    ScottPletcher (8/30/2013)


    Sean Lange (8/30/2013)

    NOLOCK hints. They are NOT a performance boost.

    To me, that's not a logical claim. While NOLOCK is clearly...

    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 - 6,406 through 6,420 (of 7,619 total)