Forum Replies Created

Viewing 15 posts - 3,841 through 3,855 (of 7,613 total)

  • RE: Getting first Saturday of February for any year

    Here's the function to compute any given day for any given month:


    SET ANSI_NULLS ON;
    SET QUOTED_IDENTIFIER ON;
    GO
    CREATE FUNCTION dbo.GetFirstGivenDayOfMonth (@month date, @day tinyint...

    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: Alternating Cursors?

    I don't think you need a cursor for the index checks, although it's probably easiest to use a cursor to go thru the databases.  See if the code below will...

    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: Getting first Saturday of February for any year

    Thom A - Monday, April 10, 2017 9:49 AM

    Thanks Scott, didn't really consider using Math logic. Although, I'll admit, not as readable,...

    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: Getting first Saturday of February for any year

    An inline function is a good idea, but I'll leave it scalar for now so you can just replace your existing function.  I would definitely not use I/O to do...

    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: Improving performance using partitioning

    Cluster the header table on the date column.
    Cluster the detail table on the key from the header table.  Get the key/fk by querying the header table first.
    Edit: On 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: redesigning table to accommodate new data types

    hlsc1983 - Sunday, April 9, 2017 9:55 AM

    ScottPletcher - Monday, February 20, 2017 10:26 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: redesigning table to accommodate new data types

    hlsc1983 - Friday, April 7, 2017 2:13 PM

    ScottPletcher - Thursday, April 6, 2017 1:17 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: redesigning table to accommodate new data types

    roger.plowman - Tuesday, April 4, 2017 2:05 PM

    ScottPletcher - Tuesday, April 4, 2017 1:41 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: redesigning table to accommodate new data types

    hlsc1983 - Thursday, April 6, 2017 12:44 PM

    ScottPletcher - Monday, February 20, 2017 10:26 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: Question about Clustering & Includes

    1) Technically, no, since clus key column(s) are automatically included in all non-clus indexes. But I like to explicitly code it when it's needed to make this index a...

    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 join these tables together

    jcelko212 32090 - Wednesday, April 5, 2017 12:57 PM

    Jeff Moden - Tuesday, April 4, 2017 6:22 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: Removing Reverse Duplicates

    Presumably the lower number is always first for single entries (if not, fix that! 🙂 ).


    SELECT L.*
    FROM Links L
    WHERE L.ClientRef < L.LinkedClientRef

     

    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 trigger transaction

    Agree. something like below.  Keep the trigger code as efficient as possible.  (Btw, cluster the new table on LOG_TIME first, to make processing and clean up of that table 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: redesigning table to accommodate new data types

    roger.plowman - Tuesday, April 4, 2017 2:05 PM

    ScottPletcher - Tuesday, April 4, 2017 1:41 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: How to join these tables together

    Bill Talada - Tuesday, April 4, 2017 12:23 PM

    This all reminds me of co-workers asking what is the part number.  Are they...

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