Forum Replies Created

Viewing 15 posts - 1,201 through 1,215 (of 7,613 total)

  • Reply To: replace chain of function calls with better code

    Mr. Brian Gale wrote:

    I second the "nonwork_days" table, but I would make sure to design the reason code table well.

    You would want to make sure that the reason code table has 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".

  • Reply To: replace chain of function calls with better code

    I very strongly prefer a separate "nonwork_days" table.  The table needs nothing only the date and a tinyint reason code for why that date is a nonwork day.

    The big problem...

    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: Splitting table into multiple tables

    Partitioning often serendipitously helps with performance.  That's because people will create a different clustered index to help with the partitioning process and that new clustered index actually does help 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".

  • Reply To: Splitting table into multiple tables

    Again, how do you search the table?  That is, what are the common WHERE clauses that you use on the table?  That is what should control the clustering.

    If you (almost)...

    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: Splitting table into multiple tables

    How do you search the table?  It's likely you would get better performance using partitioning based on how you search the table, esp. if you can partition / cluster first...

    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: Capture rejected rows during bulk inserts.

    Jeff Moden wrote:

    My recommendation  would be to read the documentation for BULK INSERT, which is located at the following URL:

    https://docs.microsoft.com/en-us/sql/t-sql/statements/bulk-insert-transact-sql?view=sql-server-ver15

    The two keywords to search for in that article are ERRORFILE...

    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: Capture rejected rows during bulk inserts.

    Jeff Moden wrote:

    ScottPletcher wrote:

    Jeff Moden wrote:

    ScottPletcher wrote:

    A trigger is the perfect approach for this.  Some developers just irrationally avoid triggers no matter what.

    Be sure to specify option FIRE_TRIGGERS in your BULK INSERT...

    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: Capture rejected rows during bulk inserts.

    Jeff Moden wrote:

    ScottPletcher wrote:

    A trigger is the perfect approach for this.  Some developers just irrationally avoid triggers no matter what.

    Be sure to specify option FIRE_TRIGGERS in your BULK INSERT command.

    The duplicate...

    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: SET TRANSACTION ISOLATION LEVEL READ UNCOMMITTED ???

    The SET applies to all SELECTs.

    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: Using Between With Joins

    You're welcome.  I'm very glad it helped.  And thanks for the follow-up and nice feedback!

    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: Capture rejected rows during bulk inserts.

    A trigger is the perfect approach for this.  Some developers just irrationally avoid triggers no matter what.

    Be sure to specify option FIRE_TRIGGERS in your BULK INSERT command.

     

    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: Why do some DBAs avoid DATETIME2?

    sgmunson wrote:

    Give me a reason to use the new data type when I can't use date functions with it natively, or can't get DATEDIFF in particular to work with 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".

  • Reply To: Closest to date within 3 days

    I too don't think OUTER APPLY is the main problem.  But I would strongly urge you to get rid of the function against the table column you are searching on,...

    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: stored procedure update

    Not much to go on, but, in general, just put the appropriate conditions in the WHERE clause:

    DECLARE @key_value ...
    DECLARE @col_value ...

    SET @key_value = ...
    SET @col_value = ...

    UPDATE...

    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: DB Naming

    Keep in mind, too, that the point of naming is to give accurate business names to objects, not to make things easier for developers.  That is, just because a naming...

    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 - 1,201 through 1,215 (of 7,613 total)