Does anyone know of amy SQL Code that will drop all the records in all the
tables at once and leave the db structure in place?
sp_msforeachtable 'TRUNCATE TABLE ?'
"DBA" <DBA@.discussions.microsoft.com> wrote in message
news:D1EC25B0-237D-45BB-89FD-A4ECA18E0360@.microsoft.com...
> Does anyone know of amy SQL Code that will drop all the records in all the
> tables at once and leave the db structure in place?
|||truncate table may not work if the table is referenced by foreign keys. You
may try scripting out the schemas and run it in a separate database to
create all table structures.
"DBA" <DBA@.discussions.microsoft.com> wrote in message
news:D1EC25B0-237D-45BB-89FD-A4ECA18E0360@.microsoft.com...
> Does anyone know of amy SQL Code that will drop all the records in all the
> tables at once and leave the db structure in place?
Showing posts with label thetables. Show all posts
Showing posts with label thetables. Show all posts
Monday, March 19, 2012
Dumb Question?
Does anyone know of amy SQL Code that will drop all the records in all the
tables at once and leave the db structure in place?sp_msforeachtable 'TRUNCATE TABLE ?'
"DBA" <DBA@.discussions.microsoft.com> wrote in message
news:D1EC25B0-237D-45BB-89FD-A4ECA18E0360@.microsoft.com...
> Does anyone know of amy SQL Code that will drop all the records in all the
> tables at once and leave the db structure in place?|||truncate table may not work if the table is referenced by foreign keys. You
may try scripting out the schemas and run it in a separate database to
create all table structures.
"DBA" <DBA@.discussions.microsoft.com> wrote in message
news:D1EC25B0-237D-45BB-89FD-A4ECA18E0360@.microsoft.com...
> Does anyone know of amy SQL Code that will drop all the records in all the
> tables at once and leave the db structure in place?
tables at once and leave the db structure in place?sp_msforeachtable 'TRUNCATE TABLE ?'
"DBA" <DBA@.discussions.microsoft.com> wrote in message
news:D1EC25B0-237D-45BB-89FD-A4ECA18E0360@.microsoft.com...
> Does anyone know of amy SQL Code that will drop all the records in all the
> tables at once and leave the db structure in place?|||truncate table may not work if the table is referenced by foreign keys. You
may try scripting out the schemas and run it in a separate database to
create all table structures.
"DBA" <DBA@.discussions.microsoft.com> wrote in message
news:D1EC25B0-237D-45BB-89FD-A4ECA18E0360@.microsoft.com...
> Does anyone know of amy SQL Code that will drop all the records in all the
> tables at once and leave the db structure in place?
Subscribe to:
Posts (Atom)