Wednesday, August 17, 2011

How to do any activity like select, delete or truncate for all tables in a databases?

Use databasename

Go
sp_tables


Filter the above query output by TABLE_TYPE AS TABLE.

Then copy all table_name column values from the results in SSMS and paste it in the excel sheet columns.

Then join table_name with below statements in another excel column.

Lets take how to truncate all tables in a database.


="TRUNCATE TABLE ” &A1 &" "


Employeesdetails
TRUNCATE TABLE  Employeesdetails


Any other method to do the above activity.

No comments:

Post a Comment

MYSQL::Setting Validate_Password componet for MySQL Database to ensure password policy settings

Inadequate Password Settings for MySQL Database We observed that the `validate_password%` settings on hostname `<insert hostname>` a...