title: How to delete data of multiple tables through Loop
body: <p>i have written the loop to delete the data in tables and print them </p>
  
  <pre><code>SET NOCOUNT ON
  
  DECLARE @Count INT = 1
  
  WHILE @Count &lt;&gt; 0
  BEGIN
        SET ROWCOUNT 100000
  
        DELETE
        FROM table1  
  
        SET ROWCOUNT 0
  
        SELECT @Count = COUNT(1)
        FROM table1  WITH (NOLOCK)
  
        --print '10000 Deleted'
        --Print cast (@count as varchar) + ' Remaining'
        DECLARE @Msg VARCHAR(100) = CAST(@Count AS VARCHAR) + ' Remaining'
  
        RAISERROR (
                    @Msg
                    , 0
                    , 1
                    )
        WITH NOWAIT
  END
  </code></pre>
  
  <p>if i want to some 10 tables at one go </p>
  
  <pre><code>select * from Sysobjects where type = 'U' and name IN ('Table1,Table2',....)
  </code></pre>
  
  <p>how i need to implement the statement in the loop delete the data table data one by one .</p>