Forum Replies Created

Viewing 15 posts - 2,911 through 2,925 (of 7,613 total)

  • RE: Script to close the excel file

    There should be some way to copy the file even with the "busy" flag on.  Then open the copy, not the original.

    That is, the logic becomes:
    check for...

    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 help to match only 3 values

    For 3 varchar values, it's tricky, and I'd have to do some testing/experimenting first. 

    For 3 numeric values, it's easy to list all 3.

    For only 2 values 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: SQL help to match only 3 values

    It looked you also wanted to list the specific values found.

    That's easy for two values, much trickier for 3 (3 numeric values is easy, but not 3 char...

    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 help to match only 3 values

    SELECT pid
    FROM @table1
    GROUP BY pid
    HAVING COUNT(DISTINCT gcode) = 3

    I don't understand why you don't have p1 and p3 in your result set.

    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: Filtering by date crashes report\query

    Would have to see the query plan to be sure, but it seems like SQL may be doing an implicit conversion on the date column, which would cause big performance...

    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: which way is better for joins? or are both options popular?

    DesNorton - Wednesday, March 6, 2019 9:35 PM

    I suspect that the question is more along the lines of ....

    Which is better?

    [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".

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

    It seems like maybe something is blocking the "slow" run, although I'm not sure what it would be.

    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: Changing the isolation level without wrapping code in BEGIN / COMMIT TRAN

    You don't need to do an explicit transaction.  Once you put the level into effect, it will stay in effect until/unless you explicitly change/override it.

    SET TRANSACTION ISOLATION LEVEL...

    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: Convert epoch to human readable date

    Divide it by 1000, to add seconds, so it seems based on the value returned:

    SELECT DATEADD(SECOND, (1551279347054/1000), '19700101')

    If you need to keep the milliseconds, you can...

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

Viewing 15 posts - 2,911 through 2,925 (of 7,613 total)