When we importing data from excel sheet to SQL database by default it add "$" in excel sheet name. Sometime you or your team member forgot to delete those tables from database. If you want to delete those excel imported tables from my database then you can use below query. It also help you to find table name like query in your database.
This below script will get all tables which contains "$" in their name
After getting these tables from database you can drop these tables.
SELECT TABLE_NAME FROM
INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME LIKE '%$%'
Hope it will help you. Keep sharing keep learning. Thank you
No comments:
Post a Comment