Forum Replies Created

Viewing 15 posts - 20,581 through 20,595 (of 49,552 total)

  • RE: Help in Updating an exception table

    If I'm understanding you correctly (you want to either insert or update depending whether the exception is already there)

    Use Merge.

    Rough syntax:

    MERGE

    [ INTO ] <target_table> [...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: TRUNCATE TABLE and ROLLBACK TRAN

    The distribution of answers is frankly terrifying.

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Null values with unique key constraint

    The usual trick is a unique filtered index.

    CREATE UNIQUE INDEX <index name> ON <table name>(<column name>)

    WHERE <Column name> IS NOT NULL

    Uniqueness only enforced over the non-null portion of the table.

    Has...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: DBCC CHECKDB Error

    Yes, the database corruption is almost certainly due to hardware problems, most likely the IO subsystem.

    There's way too much noise in that checkDB output. Please run the following and post...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Transaction Log file size issue

    The root of the problem is that you are not taking log backups.

    Please read through this - Managing Transaction Logs[/url]

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Memory management in SQL Server

    The buffer cache hit ration is another of those near-useless counters. If it's high, you may be fine or you may have a severe memory problem. If it's low, you...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: SAN related performance issue, though low disk queue length

    Ignore disk queue length. It's a meaningless counter, especially with a SAN.

    What's your disk latencies? (avg sec/read, avg sec/write)

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: complex problem

    What wait types are you seeing on the slow queries?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: changing a nonclustered index to cluster ( the index is referenced by a lot of other tables)

    Yes, it will have a major effect. I strongly suggest you do some basic reading on indexes.

    Start with this series:

    http://www.sqlservercentral.com/articles/Indexing/68439/

    http://www.sqlservercentral.com/articles/Indexing/68563/

    http://www.sqlservercentral.com/articles/Indexing/68636/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: non cluster index even after rebuild is 71 % fragemented

    No, it has nothing to do with foreign keys.

    Let me guess, the table is under 50 pages?

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: script to check if indexes for a database sql server 2008 developer edition is highly fragemented rebuild otherwise reorganize

    Developer edition can do online rebuilds, but they take even more space than offline rebuilds do.

    Scripts, certainly.

    http://sqlfool.com/2011/06/index-defrag-script-v4-1/

    or

    http://ola.hallengren.com/versions.html

    p.s. I hope I misunderstood you and you are not using developer edition for...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: subquery vs declare @mytable table

    You didn't read the article. Please do so. The easier you can make it for someone to help you, the more likely it is that someone will.

    CTE or subquery means...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: subquery vs declare @mytable table

    Please post table definitions, sample data and desired output. Read this to see the best way to post this to get quick responses.

    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Stored Procedure Compile issue

    Note that those may well increase your compile time, not decrease it. They're used when non-optimal plans are generated (for whatever reason), they are not there to allow you to...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • RE: Covered Index including the Clustered Key

    No, it will not. SQL Server is smarter than that.

    Adding the clustering key to the index if it is necessary is a sensible thing to. Otherwise, what happens when someone...

    Gail Shaw
    Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
    SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass

Viewing 15 posts - 20,581 through 20,595 (of 49,552 total)