Hi,
I tested it, but it still does not match the right schema for the tables.
Ex:
Invalid object name 'AdventureWorks.develop.Department'.
Msg 208, Level 16, State 1, Line 1
The real schema for the table 'Department' in the 'AdventureWorks' DB is
'HumanResources':
[AdventureWorks].[HumanResources].[Department]
Maybe your script, in this version, is trying to inject the SP schema into resolving table names and not using the real schema for the tables. Just a wild guess... 🙂
One more thing, may I suggest you to add as parameter the DB name?
Scanning a server instance with a lot of DB's is taking quite a while. Maybe you can use the null value for this param to indicate a full scan.
Nice job!
Cheers,
A.