Forum Replies Created

Viewing 15 posts - 2,926 through 2,940 (of 7,619 total)

  • RE: Query runs slow when executing under the context of a different DB

    Did you look at / compare the query plans?

    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: Save the actual execution plan of a SQL statement in a script

    The estimated plan will be the actual plan.  What's missing from the estimated plan is the actual row counts; in an estimated plan, naturally the query didn't actually run, so...

    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: Slow in the Application, Fast in SSMS. How to force the execution plan generated by SMSS

    Certain SQL settings being different can cause a separate execution plan to be required.  For example, QUOTED_IDENTIFIER ON vs QUOTED_IDENTIFIER OFF would definitely cause that.  Try explicitly setting all of...

    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 Database Normilization

    If you want to start over on the design, then start over on the logical design process.  The existing table has no relevance to that process.

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

  • RE: Need counts of orders per week grouped by week

    omelo - Sunday, March 3, 2019 12:03 PM

    ScottPletcher - Thursday, February 1, 2018 7:58 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: Distinct


    INSERT INTO [dbo.Distinct_Login] (
      [Today], [DatabaseName], [lOGIN_TIME], [HOSTNAME],
      [CMD], [NT_USERNAME], [LOGINAME]
      )
    select
        GETDATE() AS today, DB_NAME(dbid) AS DatabaseName, LOGIN_TIME, HOSTNAME,

    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: datetime - with 01/01/1000 date

    Or have SSIS convert that value to a different date.  Typically 1900-01-01 is used (date 0 in SQL) for that, unless you have actual data that goes back that far,...

    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: Distinct

    That's an odd requirement.  The same login could have several different processes active on SQL at the same time.  How do you want to determine which single one to list? ...

    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: why did WHERE EXISTS delete the contents of whole table?

    Something like this instead:


    delete from C
    from ods_tmus4.dbo.lgtc_shipmentsclaims_cpy C
    where exists (
    select *
    from [Admin].[dbo].[Remove Duplicates_Final] D
    Where D.[Tracking_Number] =...

    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: Compare Lists

    Goldie Lesser - Tuesday, February 26, 2019 4:31 PM

    ScottPletcher - Tuesday, February 26, 2019 2:04 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: why did WHERE EXISTS delete the contents of whole table?

    There is no connection between the table you're deleting from and the EXISTS clause.  If the EXISTS is ever true for the tables it references, even for just one row,...

    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 determine what percent of a varchar column is a valid numeric?

    That's one of the reasons SQL allows NULL "values" in columns (NULL is technically not a value, it's the absence of a value; for day-to-day purposes, you can think of...

    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: Compare Lists

    It's easy enough to get a list of the missing values.  But getting a concatenated list is somewhat more difficult.


    ;WITH cte_packages 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: Totals up to a specific date

    The "WITH" from a CTE can cause errors if not preceded by a ; if an actual statement preceded the WITH.  Therefore it's safer to prepend a ; so 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: Group by companyid with Latest date

    patrickmcginnis59 10839 - Monday, February 25, 2019 11:22 AM

    ScottPletcher - Monday, February 25, 2019 11:13 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".

Viewing 15 posts - 2,926 through 2,940 (of 7,619 total)