Forum Replies Created

Viewing 15 posts - 3,271 through 3,285 (of 7,613 total)

  • RE: Cannot reorganize an index because its disabled, but its not disabled.

    Did you verify that all the constraints are "trusted"?  If not trusted, perhaps that could cause an issue.

    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: Pivoting a 2 columns table to a 6 columns table with 1/3 the rows

    A cross tab will do it nicely.


    SELECT
        MAX(CASE WHEN rowOrder = 1 THEN xImage END) AS xImage1,
        MAX(CASE WHEN rowOrder...

    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: Prevent update trigger

    If the app/person/whatever doing the UPDATE is not a sysadmin, (or perhaps a dbo, not sure on that one), maybe you can just DENY UPDATE on that column:

    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: Dynamic SQL using sp_executesql with DbName parameter

    Another option is to create a proc in master named sp_<whatever> (the name must start with sp_), mark it as a system proc, then you can execute from any db...

    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: Clustered index scan for few items and index seek for other records

    EasyBoy - Tuesday, July 10, 2018 10:52 AM

    ScottPletcher - Tuesday, July 10, 2018 10:44 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: how do i find a specific status, and only that status

    Lynn Pettis - Tuesday, July 10, 2018 9:45 AM

    drew.allen - Tuesday, July 10, 2018 9:34 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: I need to extract the 5 char length substring between dashes


    SELECT *,
         CASE WHEN start_of_value = 1 THEN ''
         ELSE SUBSTRING(CI_NUM, start_of_value, 5) END AS [5charsyouwant]
    FROM ( VALUES('asdfasf-ABCDE-asdfasdfsfasf'),('ss-TREWQ-asdfasfsf'),
         ('asdfa-12-ABCDE-kindatricky'),('nothingtoseehere'),
     ...

    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: Clustered index scan for few items and index seek for other records

    So I guess it's doing a non-clustered index seek?  When you go that route, you have to be careful of the "tipping point", where SQL falls back to scanning 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: Performance Enquiry

    100% agree with Phil.  Get everything in one read and save/cache it for your app however you need to.  Db read round trips (from your app to the db server...

    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: Stored Procedure

    GilaMonster - Monday, July 9, 2018 3:19 PM

    ScottPletcher - Monday, July 9, 2018 10:35 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: Accurate Estimations, But Hash Match Aggregate Spilling to TempDB

    Jeff Moden - Monday, July 9, 2018 11:26 AM

    chris.o.smith - Friday, June 29, 2018 10:10 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: Stored Procedure

    GilaMonster - Monday, July 9, 2018 2:58 AM

    debasis.yours - Monday, July 9, 2018 2:20 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: how to get sum of each row and column

    Btw, I'd stronbly encourage you to use:
    and SQLDateTime < '2018-07-03T08:00:00 AM' 
    rather than:
    and SQLDateTime <= '2018-07-03T07:59:00 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: How to restore SQL server database from damaged MDF file?

    As both of us have stated, run a CHECKDB to get an idea of the scope of the problem.  One error or 100 errors?

    I forgot to mention before...

    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 restore SQL server database from damaged MDF file?

    hobsongeorge9276 - Friday, July 6, 2018 7:36 AM

    Hello everyone, My SQL server data file has been corrupted and I do not have...

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