• I don't think it should be called negative at all. Other than a poor reply on the English which should be ignored as we must understand we are not all using English as our primary language and only respect the attempt to post and use it to better reach the audience. The replies have been nothing more than help to build on the posters knowledge and who reads the article. Posts like that can be handled by the administration of this site and not by endless discussions again far out of scope.

    A few things I noticed. sysname should be the data type when going after things like instance, database, tables etc..

    DECLARE @dbname AS SYSNAME

    Another is cursors should be avoided. Reasoning is out there and way out of scope of this article but just something to make others look into.

    Lastly I would recommend against using SP_MSforeachdb. undocumented or not it is on the deprecation list and if it is being used these types of things are commonly overlooked by DBA's and developers when upgrades are done. Thus causing loss of production and sometimes lengthy troubleshooting tasks that could have been prevented.