Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL Server 2005 Dependency Question...

Status
Not open for further replies.

bmgmzp

Programmer
Aug 18, 2006
84
US
I'm trying to delete a table in sql server and it tells me that there are stored procedures and views that depend on this table and therefore i cannot delete it. I've looked into a few of these stored procedures and its not using the table. So why does it keep telling me there is a dependency?

Any adivce?

Thanks.
 
Something was created with schemabinding using this table.

Check the sys.sql_dependencies dmv to see which objects are using the table. You will need to check them all to find the problem one.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
I'm not sure what you mean. What is dmv? And how am I supposed to use sys.sql-dependencies to solve my problem?

Sorry, would you mind spelling it out for me a little bit more. :)
 
Query the sys.sql_dependencies view and it will tell you every object (procedures, triggers, etc) which references the table. One or more of those objects will have been created with SCHEMABINDING and will need to be removed before you can remove the table.

Denny
MCSA (2003) / MCDBA (SQL 2000)
MCTS (SQL 2005 / Microsoft Windows SharePoint Services 3.0: Configuration / Microsoft Office SharePoint Server 2007: Configuration)
MCITP Database Administrator (SQL 2005) / Database Developer (SQL 2005)

--Anything is possible. All it takes is a little research. (Me)
[noevil]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top