Forum Replies Created

Viewing 15 posts - 1,081 through 1,095 (of 7,613 total)

  • Reply To: Need help optimizing TSQL

    Michael L John wrote:

    ScottPletcher wrote:

    Michael L John wrote:

    My favorite lie is that NOLOCK improves performance.

    Of course it must vs taking locks.

    "and use snapshot isolation."  MEGA-HUGE overhead.  SI should only be used when...

    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: String

    "Switching to alphanumeric" from what?  Int, bigint?  If so, have you used negative numbers yet?  Typically the quick-and-dirty way to stretch values is to use the full range of negative numbers. ...

    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: Need help optimizing TSQL

    Michael L John wrote:

    And, in never changing historical data, this is read only.  Use a read only connection, and use snapshot isolation.

    You can't use a "read-only connection" in/for a proc that does...

    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: Need help optimizing TSQL

    Michael L John wrote:

    My favorite lie is that NOLOCK improves performance.

    Of course it must vs taking locks.

    "and use snapshot isolation."  MEGA-HUGE overhead.  SI should only be used when truly necessary.

    You need 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: clustered index usage

    Jeff Moden wrote:

    ScottPletcher wrote:

    MMartin1 wrote:

    Brahmanand Shukla wrote:

    Yes, agree that it would benefit in the read loads. But we should also consider the overhead of CI on write operations. So if the database...

    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: Need help optimizing TSQL

    Michael L John wrote:

    ScottPletcher wrote:

    aaron.reese wrote:

    It really depends on whether you understand the consequences of NOLOCK.  It can result in a 'dirty read' if there are uncomitted transactions in the database 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: clustered index usage

    MMartin1 wrote:

    ScottPletcher wrote:

    MMartin1 wrote:

    Brahmanand Shukla wrote:

    Yes, agree that it would benefit in the read loads. But we should also consider the overhead of CI on write operations. So if the database...

    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: clustered index usage

    MMartin1 wrote:

    Brahmanand Shukla wrote:

    Yes, agree that it would benefit in the read loads. But we should also consider the overhead of CI on write operations. So if the database is read-intensive...

    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: Need help optimizing TSQL

    aaron.reese wrote:

    It really depends on whether you understand the consequences of NOLOCK.  It can result in a 'dirty read' if there are uncomitted transactions in the database that affect 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: SQL Query Help on Time based query

    Probably this?!:

    ;WITH Cte_Test_With_Row_Nums AS (
    SELECT *,
    ROW_NUMBER() OVER(PARTITION BY UserID, Schedule_Start_Date ORDER BY Start_Time) AS 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".

  • Reply To: Update alias or update tablename when from clause is specified

    Jeff Moden wrote:

    ScottPletcher wrote:

    Once you assign an alias to a table, that alias is the only valid way to reference that table.  That's not a matter of preference or opinion.  It's...

    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: Update alias or update tablename when from clause is specified

    Jeff Moden wrote:

    You have to understand... I don't actually care what the question was.  This isn't stack overflow.  I was teaching about the proper forms and you don't need a FROM...

    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: Update alias or update tablename when from clause is specified

    Jeff Moden wrote:

    ScottPletcher wrote:

    Jeff Moden wrote:

    There is no need for the FROM clause in the first example.

    I also prefer the second example because it's easy to change it to a SELECT 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: Update alias or update tablename when from clause is specified

    Once you assign an alias to a table, that alias is the only valid way to reference that table.  That's not a matter of preference or opinion.  It's a SQL...

    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: Update alias or update tablename when from clause is specified

    Jeff Moden wrote:

    There is no need for the FROM clause in the first example.

    I also prefer the second example because it's easy to change it to a SELECT to see 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".

Viewing 15 posts - 1,081 through 1,095 (of 7,613 total)