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

Popular posts from this blog

php - What is the difference between $_SERVER['PATH_INFO'] and $_SERVER['ORIG_PATH_INFO']? -

fortran - Function return type mismatch -

queue - mq_receive: message too long -