SQL Complete makes it easy to find invalid objects in multiple databases. This feature helps to learn if any objects reference other objects that no longer exist.
1. Open the Find Invalid Objects window by using one of the following ways:
2. Specify the connection and select the databases to search for invalid objects.
3. Click Analyze to start searching.
Invalid objects are displayed in a grid that includes a type of the database object, the schema it belongs to, the name of the invalid object, and the reason why it is deemed invalid.
In the Find Invalid Objects window, you can perform the following tasks:
Right-click the invalid objects and select on the shortcut menu:
Generate the ALTER and DROP scripts for the invalid objects to a new SQL document or to the clipboard.
Note
If you want to script an object to clipboard, click the down arrow next to Script as ALTER or Script as DROP and select To Clipboard.
You may face the following error while looking for invalid objects in databases with more than 5,000 objects:
Could not find a part of the path 'C:\Users\User1\AppData\Local\Temp\Devart\691f7f39ac7f43da86.tmp'
The root cause of this issue is the restricted temporary file usage.
Possible reason | How to fix |
There was not enough space on the disk C:\ to create temporary files. | Create the C:\Users%WinUser%\AppData\Local\Temp\Devart folder manually. |
Saving the temporary file might have failed due to timeout caused by antivirus. | Disable antivirus. |
Restricted access to the Devart folder for the user that launches SSMS. | Make sure all the users have both Read and Write permissions. |