How can we help you today? How can we help you today?

How come SQL Prompt doesn't flag Invalid Synonyms in the 'Find Invalid Objects' routine

It is easy enough
<div>SELECT DB_NAME() AS DBName, Name AS Synonym, base_object_name AS RefersTo,
'DROP SYNONYM ' + SCHEMA_NAME( schema_id) + '.' + Name + ';' AS Fix
<span style="background-color: transparent; color: inherit; font-size: inherit; font-family: roboto, "helvetica neue", Arial, sans-serif;">FROM sys.synonyms</span></div><div><span style="background-color: transparent; color: inherit; font-size: inherit;"><font face="roboto, helvetica neue, Arial, sans-serif">WHERE DB_ID( PARSENAME( base_object_name, 3 ) ) IS NULL</font>
</span><span style="background-color: transparent; color: inherit; font-size: inherit; font-family: roboto, "helvetica neue", Arial, sans-serif;">ORDER BY Name;</span></div>


SQLOzzie
Ozzie
0

Comments

1 comment

  • Jessica R
    Hi @Ozzie,

    Thanks for your post!

    I'm afraid the way that the "find invalid objects" feature is currently written, it's not possible to check the validity of a synonym (the correctness of synonym goes beyond the current mechanism scope).

    To request this feature, could you please add a request to our uservoice forum here so that others can vote to add it as well?

    Thank you!

    Jessica Ramos
    Jessica R
    0

Add comment

Please sign in to leave a comment.