Is this syntax correct?

  • Hello,

    I am trying to delete all records in all tables in a single database. Which of these stored procedure syntax is correct for doing that?

    exec sp_msforeachtable 'truncate table tablename'

    or

    exec sp_msforeachtable 'delete table tablename'

     

    Also...I am assuming that these stored procedures would NOT alter any of those sytem(sys) tables in the database.

     

    Thanks.

    Ram


    Thanks,

    Ram Ganesan

  • Please don't cross (double) post. You have this posted elsewhere on this site and have received responses there.

    -SQLBill

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply