Forum Replies Created

Viewing 15 posts - 1,306 through 1,320 (of 7,613 total)

  • Reply To: MSSQL Table Variable Identification

    I believe SQL caches table variables the same way it does for temp tables.  If so, an entries for them would still be in the system tables.  It 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: Query causing compilation timeouts and huge cost = 8.28104

    For the actual tables, post the DDL, including all indexes.

    For any views, post the view definition.

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

    Agree, there's no super-easy, "automatic" way to do that.  However, you can generate a script(s) that will change each column as needed, so it's not like you have 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".

  • Reply To: Cursor replacement suggestions

    To allow me to write full code, would you provide the full DDL for the Error_Log table?  The big gain will come from encoding strings as numbers using a conversion...

    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: Key Lookup to Clustered Index

    Of course it's optional if you make the new clustering index a PK or not.

    That is, you could drop the existing PK, create the new clustering index, then re-add 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: Key Lookup to Clustered Index

    Get rid of the functions around the usrt_dtm_DateTime column; you don't need them and they will prevent lookup seeks, drastically harming performance:

    SET @ToDate = CAST(@ToDate AS date)...

    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: FORCED PARAMETERIZATION for syntactically similar but not precisely same query.

    If the Production.ProductInventory table is clustered on ProductId (and it almost certainly should be), and you specify a specific ProductId or a list of ProductIds, as in the WHERE clause...

    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: Not getting expected index seek.

    Jeff Moden wrote:

    Jackie Lowery wrote:

    Jeff Moden wrote:

    Looking at the Clustered Index for the oeordlin_sql table, I'm a wee bit concerned (especially for insert and update performance) over having the leading column be in...

    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 Function

     

    SELECT 
    J.Job,
    J.Category,
    COALESCE(C.Value, C_All.Value) AS Value
    FROM Job J
    LEFT OUTER JOIN Category C ON C.Category =...

    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: Cursor replacement suggestions

    Sorry, no, I just need to get time to get back to it.  I should be able to do that tomorrow.

    We have to reduce the overhead in the Write proc...

    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: Not getting expected index seek.

    Jackie Lowery wrote:

    ScottPletcher wrote:

    Actually, it depends on how the table is searched.

    Do you often filter the rows by only type when SELECTing?  If so, then the clus index makes sense...

    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: Not getting expected index seek.

    Jackie Lowery wrote:

    Jeff Moden wrote:

    Looking at the Clustered Index for the oeordlin_sql table, I'm a wee bit concerned (especially for insert and update performance) over having the leading column be in the...

    • This reply was modified 4 years, 10 months ago by ScottPletcher. Reason: Edited to improve clarity

    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: Copy an existing table to a new table...

    stephen.aa wrote:

    None of this works:

    ...

    SELECT * INTO 2415_10_Ga_Trunking_Design_Configurator FROM 2415_12_Ga_Trunking_Design_Configurator

    What about that doesn't work?

    If you don't want any data in the table, use TOP (0) and/or WHERE 1 = 0...

    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: I need to combine these two query's

    You're welcome.  Thanks for the feedback.

    If you would mark it as the answer, it could help people looking at this later, as they will then know the q has been...

    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: Is that a reason DBA should Install SQL Server

    Jeff Moden wrote:

    Our situation appears to be quite a bit different than yours (and no... neither is wrong, IMHO... they're just different because of different business requirements).  My best friend, who...

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