September 27, 2010 at 12:48 pm
I need to change the data type of one of my table fields from MONEY to DECIMAL(20,5). Before making the change I did View Dependencies on the table and it listed one view (vwOrderDetails).
So I went into the table designer, changed the field and viewed the Change Script that was generated by SSMS. It had a bunch of ALTER VIEW statements on about 10 other VIEWs. Probably because they all depend on the first view.
I also previously ran three other stored procedures to make sure I didn't miss any other dependencies (like sp_depends etc...).
Since everything looked ok, I decided to run the change script that SSMS generated. After I ran the script, View Dependencies did not list any dependencies anymore, even though I know at least one exists.
vwOrderDetails is still there and it depends on tblOrderDetails.
Can someone explain why this happens?
Thanks
Ray
September 28, 2010 at 6:59 am
Because the dependency viewing in SQL Server is more than a little bit messed up. Try running a query against sys.dm_referencing_entities to get the objects that are referring to the table. You can also use sys.dm_referenced_entitities the other direction.
"The credit belongs to the man who is actually in the arena, whose face is marred by dust and sweat and blood"
- Theodore Roosevelt
Author of:
SQL Server Execution Plans
SQL Server Query Performance Tuning
September 28, 2010 at 8:56 am
I believe those are specific to SQL2008, I'm using SQL2005.
Viewing 3 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy