表删除 对应的索引自动删除了。。至于 视图 在删表之前先找用到的视图 然后drop掉
select distinct object_name(id) from syscomments where id in (select id from sysobjects where type in('V','P')) and text like '%tablename%'表删除后,表上的index 会自动删除,,对于view,可以使用 模糊查询,如果定义中存在响应的table name,将其删除即可
select * from sys.sql_modules where definition like '%table name%'