Forum Replies Created

Viewing 15 posts - 2,131 through 2,145 (of 7,613 total)

  • Reply To: Table Alerts

    WHERE 
    D >= DATEADD(MINUTE, DATEDIFF(MINUTE, 0, GETDATE()) / 15 * 15, 0) AND
    D < DATEADD(MINUTE, DATEDIFF(MINUTE, 0, GETDATE())...

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

  • Reply To: Execution plan flips from "good" to "bad" at a certain threshold

    For the ~100K rows in the tmp table, what percent range of the DeliveryTimetableID values in the larger tables do they represent?

    That is, if the min/max values of DeliveryTimetableID 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".

  • Reply To: Find MAX value from another table

     


    SELECT B.InsDtTime, A.RunDate, A.AID, A.AValue AS NewValue, B.AValue AS OldValue
    FROM #tblTest1 A
    CROSS APPLY (
    SELECT TOP (1) *
    FROM #tblTest2 B
    ...

    • This reply was modified 5 years, 7 months ago by ScottPletcher. Reason: Corrected bugs in the query

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

  • Reply To: Execution plan flips from "good" to "bad" at a certain threshold

    Hmm, unless your data involves most of the table, I would think SQL could use a MERGE join rather than the HASH join for all those rows.  Would you 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".

  • Reply To: How do you convert a timestamp into a date

    jcelko212 32090 wrote:

    Everything we do today is affected by punchcards, and then by COBOL. Look at how 00 programming still assumes a procedural model.

    Are you surprised that all animals have DNA?...

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

  • Reply To: IF IF IF versus IF Condition 1 and condition 2 and condition X

    Eirikur Eiriksson wrote:

      IF (
    (
    (ABS(SIGN(@Var1-@VarA)))
    ...

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

  • Reply To: Table Alerts

    Phil Parkin wrote:

    ScottPletcher wrote:

    Phil Parkin wrote:

    ScottPletcher wrote:

    Phil Parkin wrote:

    Similar to what Grant mentioned, I'd suggest creating a table to help manage the process. Run a process every day to update the table with...

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

  • Reply To: Table Alerts

    Phil Parkin wrote:

    ScottPletcher wrote:

    Phil Parkin wrote:

    Similar to what Grant mentioned, I'd suggest creating a table to help manage the process. Run a process every day to update the table with the next...

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

  • Reply To: IF IF IF versus IF Condition 1 and condition 2 and condition X

    jcelko212 32090 wrote:

    In the old days, particularly with PL/1, we would do the multiple IF's. Because it was easy to slip a new punchcard in the deck when we found we...

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

  • Reply To: Sql error log

    > we renamed the sql error log out file in agent properties <<

    I think that would require a recycle of SQL Server.  You don't need to do that.  You should...

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

  • Reply To: Execution plan flips from "good" to "bad" at a certain threshold

    Try better clustering in a test system somewhere.  You might be pleasantly astounded by the results.

    Table dbo.TSys_Lookup_Date D should almost certainly be clustered first on [Date].

    Try clustering dbo.T_DeliveryTimetableItem and dbo.T_DeliveryTimetableItemResolvedCost...

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

  • Reply To: Table Alerts

    Phil Parkin wrote:

    Similar to what Grant mentioned, I'd suggest creating a table to help manage the process. Run a process every day to update the table with the next day's planned...

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

  • Reply To: IF IF IF versus IF Condition 1 and condition 2 and condition X

    Eirikur Eiriksson wrote:

    ScottPletcher wrote:

    Eirikur Eiriksson wrote:

    ScottPletcher wrote:

    It's not worth that risk for such a tiny gain. 

    In a single execution, the gain may be small, bring it up to 100K/Sec and 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".

  • Reply To: How to reduce lock or avoid lock while encoding SQL statement

    Waiting for locks is normal in SQL Server (or any other relational db).

    Whether the waits are excessive is a different q.

    Since you've provided no details, to reduce bad effects 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".

  • Reply To: Table Alerts

    You could run the job every minute.  But I'd say run the job every 10 minutes (or, I guess, 5 minutes).  Would it really be that big a deal 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".

Viewing 15 posts - 2,131 through 2,145 (of 7,613 total)