sql server 2005 - Delete all records from all tables of database -
is there anyway delete records tables of database yet keeping constraints.
i used script available on net fails foreign keys defined.
please provide step step illustration i'm new databses.
thanks!
create procedure sp_emplyalltable exec sp_msforeachtable ‘alter table ? nocheck constraint all’ exec sp_msforeachtable ‘delete ?’ exec sp_msforeachtable ‘alter table ? check constraint all’ go
Comments
Post a Comment