Forum Replies Created

Viewing 15 posts - 3,466 through 3,480 (of 7,619 total)

  • RE: Campare the 2 highest transaction

    cfm - Friday, April 13, 2018 11:50 AM

    ScottPletcher - Friday, April 13, 2018 11:18 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: Performance of Select Into vs Insert

    Would it result in better performance is I created the table and used INSERT instead of Select Into? 

    For that INSERT, no.  In fact, SELECT ... INTO dbo.new_table...

    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: Campare the 2 highest transaction

    cfm - Friday, April 13, 2018 10:22 AM

    ScottPletcher - Friday, April 13, 2018 8:46 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: Campare the 2 highest transaction


    DECLARE @start_date date
    DECLARE @end_date date
    SET @start_date = DATEADD(YEAR, -1, GETDATE())
    SET @end_date = GETDATE()

    SELECT
      AccountNumber,
      CASE WHEN MAX(CASE WHEN row_num =...

    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 conversion oddity

    Btw, just based on the pattern of code in your OP, it looks like you're doing a BETWEEN range on a datetime.

    Put simply, DON'T do that, ever.

    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: Trying to reduce RID Lookups

    andrew 67979 - Thursday, April 12, 2018 9:11 AM

    Ref point 1B is this what you mean ?

    Yes, that 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: Get all index definitions from all databases and all tables

    Why do you need to save it in a string format?  Could you just grab the meta-data instead, and leave it a table format until/unless you actually needed to convert it...

    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: Deriving a column from another derived column - conversion issues.

    I can't see any reason to test a COUNT(*) for "ISNUMERIC", since by definition a COUNT will be an int value.

    Given that, I think this query does what...

    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: Trying to reduce RID Lookups

    1) Verify that table "DonAlias" is (1A) clustered by Donor_No or (1B) a nonclus index is keyed by Donor_No and contains Alias (as key or not, with or without other...

    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: Update Trigger

    Ken at work - Tuesday, April 10, 2018 12:22 PM

    Thank you, I think I'm going to give this a try.
    I was curious,...

    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: Shrinking log file

    How old is the oldest transaction?  Sounds like you might have a long-ago task that couldn't complete for some reason.  Remember, with replication, SQL can't reuse any part of the log until...

    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: Best way to perform calculation stored as varchar

    I suppose you could create a computed column(s) in a dummy table, with a base dummy column, assuming you could live with the overhead of creating a separate computed column...

    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: Update Trigger


    SET ANSI_NULLS ON;
    SET QUOTED_IDENTIFIER ON;
    GO
    CREATE TRIGGER udLaborTracking__TRG_UPD_Set_LastJob
    ON dbo.udLaborTracking
    AFTER UPDATE
    AS
    SET NOCOUNT ON;
    IF UPDATE(Job)
    BEGIN
      UPDATE ult  /*this is critical:...

    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: Coalesce and simple pivot (or group by?)

    Since the values are purely numeric -- int in this case -- you can handle up to 3 values without having to use XML.  Because of the overhead of invoking...

    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: Db name inside the stored proc

    Sergiy - Wednesday, April 4, 2018 8:58 PM

    patrickmcginnis59 10839 - Wednesday, April 4, 2018 1:45 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,466 through 3,480 (of 7,619 total)