|
I am getting the following error when run the below script.
(comments are locked)
|
|
You are trying to return 5 columns into 2 columns, when you specify Also from BOL
I am finding all object dependencies on a table in SQL server 2005. It gives me a syntax error for sys.dm_sql_referenced_entities
Jul 08 '11 at 09:02 AM
anjaliv
This is why it is important to specify the version and edition you are using as part of the question.
Jul 08 '11 at 09:07 AM
AaronBertrand
Sorry.. forgot to mention SQL server 2005 version at the start of the question.
Jul 08 '11 at 09:09 AM
anjaliv
If using SQL 2005, then use the sys.sql_dependencies system view
Jul 08 '11 at 09:21 AM
Kev Riley ♦♦
(comments are locked)
|
|
sp_depends returns two result sets and so you can't handle it that way. I would recommend using sys.sql_expression_dependencies, sys.dm_sql_referencing_entities and sys.dm_sql_reference_entities instead. These system views are a lot easier to query and will give you the results you need.
(comments are locked)
|

