Forum Replies Created

Viewing 15 posts - 6,286 through 6,300 (of 7,613 total)

  • RE: SYNTAX Help please...

    I don't object to ISNULL() in the SELECT list, just in WHERE conditions. Since it shouldn't be used in WHERE, it's only consistent not to use it in IF...

    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: SYNTAX Help please...

    I'm truly curious now:

    Can anyone tell me:

    Where "IS NULL" can't be used in place of ISNULL()?

    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: SYNTAX Help please...

    Evil Kraig F (12/18/2013)


    Scott,

    I'm not sure how that's more or less obscure, but it's certainly easier for me to read. I work with a lot of 'iffy' data 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: SYNTAX Help please...

    Lynn Pettis (12/18/2013)


    ScottPletcher (12/18/2013)


    Lynn Pettis (12/18/2013)


    Lynn Pettis (12/18/2013)


    Luis Cazares (12/18/2013)


    ScottPletcher (12/18/2013)


    Better to avoid ISNULL, since you should never use it in a WHERE clause. I also think that exactly...

    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: SYNTAX Help please...

    Lynn Pettis (12/18/2013)


    Lynn Pettis (12/18/2013)


    Luis Cazares (12/18/2013)


    ScottPletcher (12/18/2013)


    Better to avoid ISNULL, since you should never use it in a WHERE clause. I also think that exactly what's being tested...

    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: SYNTAX Help please...

    Lynn Pettis (12/18/2013)


    Luis Cazares (12/18/2013)


    ScottPletcher (12/18/2013)


    Better to avoid ISNULL, since you should never use it in a WHERE clause. I also think that exactly what's being tested is clearer.

    IF...

    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: SYNTAX Help please...

    Luis Cazares (12/18/2013)


    ScottPletcher (12/18/2013)


    Better to avoid ISNULL, since you should never use it in a WHERE clause. I also think that exactly what's being tested is clearer.

    IF (@category 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".

  • RE: How to avoid KeyLookpu in Execution Plan of a Query ?

    If your lookups will most often be by column2, you need to cluster the table on column2, or an encoded version of it, rather than having a dopey, useless 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: need help on design of database for student registration system

    Yes, definitely do a logical design first. Don't even think about artificial keys yet.

    You need to identify "entity" and "attribute". Roughly:

    Entity = things about which you store unique...

    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: SYNTAX Help please...

    Better to avoid ISNULL, since you should never use it in a WHERE clause. I also think that exactly what's being tested is clearer.

    IF (@category IS NULL OR @category...

    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: Alternatives To Left Join: Poor Performance of Procedure

    Rewriting the query and/or adding nonclustered indexes won't help, unless you basically rewrite the entire table by including a gazillion in the nonclus index(es) -- and constantly maintain it 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: Nested CASE WHEN in SELECT

    I think you need a GROUP BY rather than a DISTINCT.

    Is the code below closer/close to the final output you want?

    SELECT

    e.ID,e.FirstName,e.Area

    ,s.ID,s.Qty,s.ProductName, s.Sale

    FROM...

    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: Table row count grouped by date

    Sean Lange (12/16/2013)


    A slight modification to the fine code Luis posted should work for you. I changed the global temp table to instead use a temp table inside the dynamic...

    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: Performance Opinion

    kapil_kk (12/14/2013)


    ScottPletcher (12/13/2013)


    I suggest making index changes scripted below, following these steps:

    1) Capture and save the existing index missing/usage stats for that table immediately, before any hanges are made.

    2) Run...

    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: Performance Opinion

    I suggest making index changes scripted below, following these steps:

    1) Capture and save the existing index missing/usage stats for that table immediately, before any hanges are made.

    2) Run the code...

    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,286 through 6,300 (of 7,613 total)