not sure if this will work as i dont have access to sql 7, but you can tweak it easy enough.
Code:
SELECT 'DROP TABLE ' + o.name, i.rowcnt
FROM sysindexes i join sysobjects o on i.id = o.id
WHERE indid < 2 and (OBJECTPROPERTY(object_id(o.name), N'IsTable')) = 1
and o.name <> 'sysdiagrams'
and i.rowcnt = 0
order by 2 desc
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.