How to delete all rows from all tables in a SQL Server database? - Stack Overflow

How to delete all rows from all tables in a SQL Server database? - Stack Overflow

瀏覽:1272
日期:2025-09-28
How to delete all rows from all tables in a SQL Server database? ... Set nocount on Exec sp_MSForEachTable 'Alter Table ? NoCheck Constraint All' Exec sp_MSForEachTable ' If ObjectProperty(Object_ID(''?''), ''TableHasForeignRef'')=1 Begin -- Just to know ...看更多