|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Friday, April 19, 2013 3:04 AM
Points: 139,
Visits: 46
|
|
Hi, I am Rajasekar,
How to delete a records in whole database(in this database having more than 200 tables)
|
|
|
|
|
Old Hand
      
Group: General Forum Members
Last Login: Friday, May 17, 2013 12:39 PM
Points: 346,
Visits: 1,816
|
|
Use the information_schema.tables view to help you write a script that does what you need. I do this regularly with selects similar to select 'first part of text ' + table_name + ' rest of text' from information_schema.tables where criteria for table names.
Run the script to text and then copy the output to a query window and execute. We have computers, let htem do the hard, repetitive work.
|
|
|
|
|
SSC-Enthusiastic
      
Group: General Forum Members
Last Login: Monday, October 04, 2010 6:59 AM
Points: 113,
Visits: 119
|
|
Since you want to do the "whole" db. Would it not be faster to just script all the tables and associated constraints & settings (or probably the whole DB), drop the old tables create new ones?
I guess the potential pitfall is any internals (like hypotheticals) for performance are potentially lost but it could also be an improvement?
|
|
|
|
|
SSC Eights!
      
Group: General Forum Members
Last Login: Today @ 6:39 AM
Points: 810,
Visits: 1,193
|
|
This database doesn't have any "lookup" tables? It's all user data?
Either above suggestion would work, as long as you don't have "lookup" table data, then you'll need to customize either of the two suggestions.
|
|
|
|