>>Check sp_depends system stored procedure to find out where this field is used.
>
>This:
>
>
>EXEC sp_depends @objname = N'MyTable.HomePhone'
>
>
>gives:
>
>"Msg 15009, Level 16, State 1, Procedure sp_depends, Line 25
>The object 'MyTable.HomePhone' does not exist in database 'MyDatabase' or is invalid for this operation."
>
>The field does exist. So, it would then be related to the other side of the sentence in regards to being invalid for this operation.
>
>Any idea on what I get this reaction?
Actually, you can not use sp_depends
The object can be a table, view, stored procedure, user-defined function, or trigger. object_name is nvarchar(776), with no default.Try
select Table_Name from INFORMATION_SCHEMA.Columns where Column_Name = 'HomePhone'
...to check how many tables use this field.
If it's not broken, fix it until it is.
My Blog