Forum Replies Created

Viewing 15 posts - 3,511 through 3,525 (of 7,613 total)

  • RE: null date parameter for a stored procedure

    sqlfriends - Tuesday, March 13, 2018 11:05 AM

    Thanks,
    oh it returns not true, then 0 record. Thanks,

    So below either one should work,
    where  sg.storedDate...

    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: Avoid subselects for single condition with max()

    TableA is not the issue.  And the subquery is not correlated, so the subquery is not directly the issue either.

    Look at the query plan.  If SQL's having to...

    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: Generate UserName from Existing table

    roger.plowman - Thursday, March 8, 2018 11:05 AM

    ScottPletcher - Thursday, March 8, 2018 10:17 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: Generate UserName from Existing table

    'm fully in agreement about normalization, though. The impedance mismatch between object oriented design and 3NF is often painful (3NF is viewed by many developers as horrifically antiquated).

    Roger.Plowman

    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: Generate UserName from Existing table

    True enough. However, one nitpick. Nothing wrong with using identities as a clustered and primary key. Mind you, my experience is designing "small to medium" OLTP systems (read, around...

    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: Generate UserName from Existing table

    roger.plowman - Thursday, March 8, 2018 7:47 AM

    Jeff Moden - Wednesday, March 7, 2018 2:14 PM

    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: Generate UserName from Existing table

    Jason A. Long - Wednesday, March 7, 2018 2:41 PM

    The really easy thing would be simply join the modern era and just...

    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: Generate UserName from Existing table

    yogi123 - Wednesday, March 7, 2018 2:36 PM

    ScottPletcher - Wednesday, March 7, 2018 2:08 PM

    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: I am given a task to troubleshoot performance issue

    ??  Nothing's changed in that query.


    ...
    from
    (
    select B.company_name as Company
    ,SUM(CASE WHEN IssMth = 1 then (CashOnly) else 0 end) as Jan1...

    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: Generate UserName from Existing table


    SELECT ID, FIRSTNAME, LASTNAME,
      FIRSTNAME + '.' + LASTNAME +
       CASE WHEN row_num = 1 THEN '' ELSE CAST(row_num - 1 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: Complex Where clause

    Those requirements seem contradictory to me.

    What I need help figuring out is how can I see if 
    All of the Difference columns are > 1 (meaning there...

    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: I am given a task to troubleshoot performance issue

    Copy the :
    where SplitEmpID is not null
    check into both the inner queries so that it execs before the UNION A-L-L, not after.

    If you at all can, change...

    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: Transaction logs

    Also, you need to either:
    1) check the number of logical log files
    2) shrink the log as much as possible, then immediately reallocate it in large chunks.
    2) is easier...

    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 to increment an alpha character suffix

    drew.allen - Tuesday, February 27, 2018 12:23 PM

    ScottPletcher - Tuesday, February 27, 2018 12:07 PM

    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: Question about a composite key and autoincrement

    jcelko212 32090 - Tuesday, February 27, 2018 10:58 AM

    ScottPletcher - Monday, February 26, 2018 5:00 PM

    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,511 through 3,525 (of 7,613 total)