I need to check if a database is totally empty (no tables) using an SQL query. How can this be done?
Thanks for the help!
If you're using SQL Server 2005 or greater, you can use one of the system views to acheive this for the current db:
select Count(*) from sys.tables where [type] = 'U'