DELETE only deleted 10000 records

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Jer

    DELETE only deleted 10000 records

    I have a stored procedure:
    DELETE FROM dbo.Period_NonL abor
    WHERE (Period_Date = '6/13/2008')

    I have to run it multiple times because it only deletes 10000 records
    each time I run it. Is there a way to force it to delete all records?

    Thanks!
  • Erland Sommarskog

    #2
    Re: DELETE only deleted 10000 records

    Jer (jerry.w.black@ saic.com) writes:
    I have a stored procedure:
    DELETE FROM dbo.Period_NonL abor
    WHERE (Period_Date = '6/13/2008')
    >
    I have to run it multiple times because it only deletes 10000 records
    each time I run it. Is there a way to force it to delete all records?
    Sounds like you have run SET ROWCOUNT 10000 at some point. Run
    SET ROWCOUNT 0, and you should be fine.

    --
    Erland Sommarskog, SQL Server MVP, esquel@sommarsk og.se

    Links for SQL Server Books Online:
    SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
    SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
    SQL 2000: http://www.microsoft.com/sql/prodinf...ons/books.mspx

    Comment

    • Jer

      #3
      Re: DELETE only deleted 10000 records

      On Aug 25, 3:04 pm, Erland Sommarskog <esq...@sommars kog.sewrote:
      Jer (jerry.w.bl...@ saic.com) writes:
      I have a stored procedure:
      DELETE FROM dbo.Period_NonL abor
      WHERE     (Period_Date = '6/13/2008')
      >
      I have to run it multiple times because it only deletes 10000 records
      each time I run it.  Is there a way to force it to delete all records?
      >
      Sounds like you have run SET ROWCOUNT 10000 at some point. Run
      SET ROWCOUNT 0, and you should be fine.
      >
      --
      Erland Sommarskog, SQL Server MVP, esq...@sommarsk og.se
      >
      Links for SQL Server Books Online:
      SQL 2008:http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
      SQL 2005:http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
      SQL 2000:http://www.microsoft.com/sql/prodinf...ons/books.mspx
      Thank you!
      that fixed it.

      Comment

      Working...