We have a SQL Server database which has quite a few tables, stored procedures, views which are not in use. The database was recently imported into a Visual Studio database project. We are using ADO.NET.
What would be the quickest way to identify all of these?
I can use the code below to manually look for each table, view etc from SSMS:
SELECT DISTINCT so.name
FROM syscomments sc
INNER JOIN sysobjects so ON sc.id=so.id
WHERE sc.TEXT LIKE '%putYouTextHere%'
or use "Find all references" on each item in visual studio's database project to check if it's used anywhere and then manually search for each table name, stored procedure name, view name etc to check if it's used anywhere in the solution.
Is there a better way to do it?