declare @tblname int declare tbl_cursor cursor for select name from sys.tables open tbl_cursor fetch next from tbl_cursor into @tblname while @@FETCH_STATUS = 0 begin EXECUTE ('truncate table '+ @tblname) fetch next from tbl_cursor into @tblname end close tbl_cursor deallocate tbl_cursor
Exec sp_MSforeachtable 'Delete from ?'
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)