Forum Replies Created

Viewing 15 posts - 6,166 through 6,180 (of 49,552 total)

  • RE: Delete or truncate

    Jeff Moden (4/14/2015)


    Since TRUNCATE is a DDL statement, might it be in the default trace? Haven't used the default trace in a million years so can't recall off the...

    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: about Life time expectency

    At that granularity, not all that much. You need to have much more granular data to be able to see trends and behaviors. I prefer to have no more than...

    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: How a new partition Function apply for Current Data

    When you create the partitioning, data will be moved to the correct partition.

    That said, it's not likely to help your performance problems, partitioning is for maintenance and fast data loads/deletes

    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: Transactions and tracking with in while loop

    Then you're either going to have to accept that the delete will have more severe impact (because it's not batched) or do something complex like insert the rows into another...

    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: Transactions and tracking with in while loop

    Naveen J V (4/15/2015)


    since table is very large, I cannot remove batch delete process.

    But by adding a transaction you'll have that effect. Deletes are done in batches to keep the...

    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: Sql71516 ,when i want create relationship between tables

    What's wrong is that the primary key of the table you're referencing is not on the column that you're using in the foreign key. A foreign key requires that the...

    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: Fatal Error

    You have a corrupt database.

    When did you last run a successful database consistency check?

    What backups do you have?

    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: Transactions and tracking with in while loop

    If you wrap that in a transaction, then you're removing the point of running batched deletes in a loop, you may as well remove the while and the top if...

    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: SELECT COUNT(*) vs DMVs to get row count

    PHYData DBA (4/14/2015)


    Then I would use SELECT count(*), GetDate() from <table name> to be certain.

    Counting every row in the table just to see whether the table has a row or...

    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 overhead question

    Robert Frasca (4/14/2015)


    columnY gets updated.

    What is the impact of the update on the index?

    The index gets updated.

    Yes, it can cause page splits if ColumnY is updated to something...

    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: My database went into suspected mode

    MotivateMan1394 (4/14/2015)


    "The dbcc run successfull or not "

    And where Do I read the reaport ?

    In the job history. When it's successful that's all the report there is.

    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: My database went into suspected mode

    MotivateMan1394 (4/14/2015)


    Can I use this command to check my databases every night. (in a job)

    Absolutely, yes. Every night if you can, less often if you don't have the time every...

    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: Delete or truncate

    Grant Fritchey (4/14/2015)


    You could try searching sys.dm_exec_query_stats in combination with sys.dm_exec_sql_text to find DELETE/TRUNCATE statements.

    Truncate doesn't get cached iirc, because it's a DDL statement

    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: Error handling in called stored procedures

    Honestly, it depends on your requirements.

    If an error in any of the 10 procedures means that the entire processing should be aborted, then error handling in the caller. If an...

    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: Delete or truncate

    Unless you had a trigger on the table or some form of auditing in place, it is extremely unlikely that you will be able to tell after the fact who...

    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 - 6,166 through 6,180 (of 49,552 total)