Forum Replies Created

Viewing 15 posts - 5,371 through 5,385 (of 7,613 total)

  • RE: The Real World: Rebuilding Index - 1 Instance, 106 Databases

    There is no such thing as an accurate, global freespace percentage. Freespace needs to be set index by index. Thus, a generic rebuild should never specify a fillfactor,...

    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: Deal with special chars - Trim?

    Trim functions deal only with spaces. The easiest way to take care of all whitespace is to use REPLACEs, something like this:

    LEFT OUTER JOIN LedgerGroups lg 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".

  • RE: Intermittent error: Cannot open database "DBNAME" requested by the login. The login failed. Login failed for user 'USER'.

    Verify that the db does not have autoclose or autoshrink set to 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".

  • RE: Very little space of harddisk problem

    I'd shrink the log file:

    DBCC SHRINKFILE ( 2, 4096 )

    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: The dreaded RBAR

    Rick Todd (2/10/2015)


    Nevyn (2/10/2015)


    What is the cash_pickups table? Seems to be in the plan but not the query? Is one of those tables a view? Or do you maybe 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".

  • RE: The dreaded RBAR

    Also, verify that you have enough free log space on that db already allocated to handle all the deletes.

    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: The dreaded RBAR

    Make sure you have nonclustered indexes on:

    transaction_hdr ( float_no )

    transaction_tenders ( float_no )

    You want SQL to scan the floats table, not use an index, since it will delete > 70%...

    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: Schema Backup

    You might want to consider putting each client schema in a different db, then using synonyms in the main db to point to those objects. It will look 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".

  • RE: Customers stopped ordering a Product query

    ;WITH cteCustRecentOrders AS (

    SELECT

    AA.[CustomerCode],

    AA.[OrderDate],

    AA.CustomerProductID,

    AA.Rank_ID

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

  • RE: What's a good indexing strategy for this situation?

    Luis Cazares (2/6/2015)


    Scott,

    I mainly agree with you, but the OP stated that there's always one Payroll_Year at a time. Based on that, I wouldn't include it in the index.

    True, 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".

  • RE: Long Running Update statement

    jdbrown239 (2/6/2015)


    I have 15 GB allocated space and 98% free

    In the log file?

    Yeah, that should be plenty, so the statement should run as fast it can.

    Are there triggers, replication or...

    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: What's a good indexing strategy for this situation?

    I'd cluster the table by:

    Payroll_Year, PayPeriod, EmployeeID and, optionally, CompanyID

    That way the clustering key is generally increasing, which will reduce fragmentation. That's not the main criterion for a clus...

    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: Long Running Update statement

    That statement is going to have the scan the table regardless of what you do.

    The critical thing for performance is to pre-allocate (and thus pre-format) enough log space for 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: Do we need to recompile the stored procedure after a table alter

    Yes. Why risk not recompiling it?

    Get the query plan id and remove all plans related to this proc from the cache using:

    DBCC FREEPROCCACHE { plan_handle }

    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: Add IF condition to WHERE clause

    JJR333 (2/5/2015)


    Thank you Scott. It is slowly dawning.

    The first NOT clause makes all the difference.

    Is this T-SQL logic different from say Excel VBA logic?

    SUM the turnover of all stores NOT...

    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 - 5,371 through 5,385 (of 7,613 total)