If you rename a host on which MSSQL is running, the MSSQL server will not be renamed internally, causing the error message “Invalid Urn filter on server level” to pop up. What this means, in this case, is that the connected SQL server doesn’t match the name the client has for it.
You can check this by running the following query:
SELECT @@SERVERNAME AS 'Server Name';
To correct the server name, from (for the sake of example) “foo” to “bar”, run this query:
sp_dropserver 'foo'; GO sp_addserver 'bar', local; GO
Restart the server and run the SELECT query again to verify the change.
20 Comments
Thank you for this post – it really helped me out. I had renamed the server but by Java install was causing some permissions issue relating to the old server name.
Thanks a lot for this, really got me out of a hole after I cloned a vmware server and couldn’t grant access in SQL.
T H A N K S, it helped me, too!
Thank you so much, my problem is solved
thank you so much issue is resolved
What a great post, saved me many hours!!! Thank you.
Cheers for this
saved me many hours!!! Thank you.
thank you .. very much!
Thanks! This has now saved me twice!
Perfect! Thank you so much!
Feature “sp_addserver” is no longer supported. Replace remote servers by using linked servers in server 2016
Thanks. This worked perfect.
Perfect! Thank you so much!
It’s 2019, 27th April, this post still helps me!. Million thanks.
Great!
I’m getting a “syntax error” with the command on SQL 2016 using SSMS v18.4:
command:
sp_dropserver ‘oldhostname\servername’;
output:
Msg 102, Level 15, State 1, Line 3
Incorrect syntax near ‘sp_dropserver’.
The sp_dropserver word is underlined red in the query editor.
Anyone has any idea on this? Google has not been helpful so far.
still working
Thank you so much!!
I had the same problem. We changed the servername on Sqlserver with the addserver command. After that we still had tons of registry settings that we had to change. We also had to change the SPN’s in AD and correct he DNS. After that we were able to modify the stored procedures. For a complete story check the blog on http://www.good2manage.com
Thank you for sharing this info. It helped me.
1 Trackback