SQL Server Setup sets the server name to the computer name during installation. If someone change the hostname of the computer after installing MSSQL, the MSSQL server name does not change and this causes error message "Invalid Urn filter on server level: filter must be empty, or server attribute must be equal with the true server name".
To check this, execute following:
1. Open cmd, type hostname and execute.
2. Open SQL management studio, in the new query window type SELECT @@SERVERNAME AS 'Server Name' and execute.
Result of 1 and 2 will not match.
To correct the server name, from (as an example) “ServerApp” to “ServerDB”, run this query in SQL management studio.
sp_dropserver 'ServerApp';
GO
sp_addserver 'ServerDB', local;
GO
Restart the server and run the SELECT query again to see the change.
For more information, click here.
To check this, execute following:
1. Open cmd, type hostname and execute.
2. Open SQL management studio, in the new query window type SELECT @@SERVERNAME AS 'Server Name' and execute.
Result of 1 and 2 will not match.
To correct the server name, from (as an example) “ServerApp” to “ServerDB”, run this query in SQL management studio.
sp_dropserver 'ServerApp';
GO
sp_addserver 'ServerDB', local;
GO
Restart the server and run the SELECT query again to see the change.
For more information, click here.
Hi ,i have two instance installed on server,both are named instances ,than what is the solution
ReplyDeleteHello Sanjeev K,
DeleteThe solution named instances is following..
sp_dropserver <'old_server_name\instancename'>
GO
sp_addserver <'new_server_name\instancename'>, local
GO
This seems helpful, but why were the example names (in the sentence preceding the sp calls) not used in the sample sp calls?
ReplyDeleteHello Charlie,
DeleteThanks for pointing out. I have corrected it.
Users have to be careful doing this if they have a Reporting Server instance running on the box in question. This procedure you outlined above may make SSRS stop working. see below for more information:
ReplyDeletehttps://docs.microsoft.com/en-us/sql/reporting-services/report-server/rename-a-report-server-computer
Hello Sanjeev K,this resolved my situation. Developers cloned an existing database server and renamed the clone server name. However the SQL engine was still handing on to the previous server name and causing issues with login.
ReplyDeleteBrilliant! Thank you so much!
ReplyDeleteThat is precisely what I was looking for...resolved my issue perfectly...THANK YOU!
ReplyDeleteThank you for this article. It help me a lot.
ReplyDeleteGlad it helped you.
DeleteI experienced this issue with LocalDb
ReplyDeleteC:\>hostname
--> DESKTOP-
SELECT @@SERVERNAME AS 'Server Name'
--> DESKTOP-\LOCALDB#4BC350F9
sp_dropserver 'DESKTOP-\LOCALDB#4BC350F9';
--> The server 'DESKTOP-\LOCALDB#4BC350F9' does not exist. Use sp_helpserver to show available servers.
sp_helpserver;
--> There are no servers defined.
The following procedure resolved the issue:
1. SSMS, Object Explorer
2. Right-click on `(localdb)\MSSQLLocalDB` node
3. Disconnect
----------------------------------------------
4. SSMS, Object Explorer
5. [Connect]v drop down
6. `Database Engine ...`
7. Server name: `(localdb)\MSSQLLocalDB`
8. Connect
Ok, then disconnect and connect is also 1 way to resolve this issue. Thanks for adding.
DeleteFixed my issue. Thanks so much !!!!!!!
ReplyDeleteYou saved my day. Thank you so much.
ReplyDeleteWhat are the advantages of online gambling? | KLH Hub
ReplyDeleteOnline gambling is 구리 출장마사지 a 천안 출장샵 new way of playing 속초 출장마사지 the casino, whether you play slots or table games. It's all about skill, not luck. But when 청주 출장마사지 a 광명 출장샵 casino
nu360 replica bags designer ku360
ReplyDelete