Forum Replies Created

Viewing 15 posts - 20,206 through 20,220 (of 49,552 total)

  • RE: Stored Procedure Help

    You have this code towards the bottom

    SELECT week_num, work_date, u.unit_description, s.shift_id, sh.shift_description

    FROM #GET_ORG_SKED

    WHERE work_date = d.dt

    There are...

    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: Execute Stored Procedure when value in a field is updated

    That said, executing a procedure inside a trigger is often a sign of a poorly written trigger. What's usually better is to write the logic directly in the trigger so...

    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 Help

    Replace

    AND

    es.work_date between '@start_date' and '@end_date'

    with

    AND

    es.work_date between @start_date and @end_date

    By putting the quotes, you made those literal string values, not parameters and SQL was trying to convert the string '@start_date' 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: Transaction log backup, tempdb negative space?

    Well shrinking TempDB online is documented to sometimes cause corruption so....

    The shrink dialogue usually works fine, so try DBCC UPDATEUSAGE

    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: Questions when database is Read Committed Snapshot and transaction isolation levels of Read Committed or Serializable are used

    GSquared (2/17/2012)


    I haven't tested Serializable in RCSI, but my understanding is that its behavior is NOT changed by RCSI, and it still holds exclusive locks on data it touches. ...

    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 using intersect

    erikpoker (2/20/2012)


    GilaMonster (2/20/2012)


    EXISTS returns true or false depending on whether a row exists in the subquery or not, so your example will delete either all the rows in the 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: Delete using intersect

    EXISTS returns true or false depending on whether a row exists in the subquery or not, so your example will delete either all the rows in the table (if that...

    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: Wondering why ERROR on a specific case of smallmoney

    DBA Rafi (2/20/2012)


    1. if with 3rd SELECT, the big value was recognized with bigger datatype (here numeric), but why this did not happened with 2nd SELECT?

    Because the second value...

    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 to avoid NOT IN?

    snigdhandream (2/20/2012)


    I tried everything, but nothing is faster or slower... everything is taking equal ms.. some times +/- 2 or 3 ms...

    Exactly, so stop worrying about NOT IN and spend...

    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: Reindexing Tables used in Log Shipping

    Please note: 5 year old thread.

    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: Table locking during large insert

    Have you considered one of the snapshot isolation levels?

    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 to avoid NOT IN?

    So you've tried creating the suggested index and know (not guess) that it won't have any effect? You've tried an IN instead and seen that it's faster?

    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: T-Log is filledup

    anthony.green (2/20/2012)


    force a checkpoint, detach the database, delete the ldf, then use CREATE DATABASE.........FOR ATTACH

    No!!

    That's a really, really good way to lose or damage a database badly, especially if 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: T-Log is filledup

    GilaMonster (2/20/2012)


    Please read through this - Managing Transaction Logs[/url] and this: http://www.sqlservercentral.com/articles/Transaction+Log/72488/

    p.s. restricted growth of 2 TB (what you say it is), is the same as unrestricted, so focus on...

    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 to avoid NOT IN?

    And you've tested and confirmed that NOT IN does indeed have performance problems?

    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,206 through 20,220 (of 49,552 total)