Forum Replies Created

Viewing 15 posts - 2,206 through 2,220 (of 7,619 total)

  • Reply To: Code to auto-update tables on set date

    Jeff Moden wrote:

    ScottPletcher wrote:

    Nothing to do with data modeling, only development.  Data modeling must precede coding.

    Just don't offer terrible modeling advice and I won't have to point it out.

    I believe you...

    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: Code to auto-update tables on set date

    Nothing to do with data modeling, only development.  Data modeling must precede coding.

    Just don't offer terrible modeling advice and I won't have to point it out.

    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: Migration step-by-step from SQL Server 2014 to 2019

    The big tasks are the SSIS packages and SSRS reports.  Often they require quite a bit of rework.  I'd start checking those out as soon as you can.

    The other stuff...

    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: Code to auto-update tables on set date

     

    The current (pseudo)design is horrifically bad.  You have non-dependent columns in tables, repeating columns (address1, address2 / phone1, phone2), update/delete anomalies all over the place, and so on.

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

  • Reply To: Unique value constraint among active records

    Make sure the [Reference_Table_Obsolete_Date] is getting populated correctly on all obsoleted rows.

    If that date is NULL for both rows (old and new), that will not be allowed for a unique...

    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: Other methods of getting the true length of UTF8 String?

    I admit I'm confused.

    LEN() has always not counted trailing spaces.

    When I need to count trailing spaces, I usually just add a non-space and then subtract 1:

    SELECT LEN('ABC' + SPACE(3)), LEN('ABC'...

    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: leave entitlement and balance

    Again, as I noted above, the current leave status (30/365 in this case) should be stored in the main employee "header"/"master" table.  Prior leave status(es) (21/365 in this case) 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".

  • Reply To: Other methods of getting the true length of UTF8 String?

    DATALENGTH() is supposed to return the byte length of the entire value.  Is is not doing that?  MS's doc seem to imply that it should (then again, we've all seen...

    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: Other methods of getting the true length of UTF8 String?

    Is your db at compatibility 150 level?  I know it almost certainly is, but I'm trying to think of anything that might cause DATALENGTH() to not work correctly (and I...

    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: leave entitlement and balance

    The employee's current leave status (yes/no, days/year) can go in the main employee table.  It should be encoded, such as a tinyint.  If the leave status changes, you store 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: Can TVF have a PK or there is a bug in my query?

    It would be helpful if you could give us the definitions of all the objects involved.

    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: Understanding execution plan query

    Yes, I believe you reading of the original plan was correct.

    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_variant to varchar error

    I believe the error was because the first data type returned by the CASE is a varchar -- specifically 'Default Memory Settings - needs to be configured' -- and thus...

    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_variant to varchar error

    You can fix the immediate problem by changing the code like so:

    else cast(value_in_use as varchar(50)) end as SQLMemoryInUse

    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: ROWLOCK UPDLOCK - Locks whole table

    I'd expect maybe a Shared lock and even a Schema lock on the table, but I don't think SQL would need to exclusively lock the 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".

Viewing 15 posts - 2,206 through 2,220 (of 7,619 total)