Attempt to retrieve data for object failed for Server '...'. (Microsoft.SqlServer.Smo) Invalid Urn f

Posted by Carisa Kissane on Tuesday, May 21, 2024

To rename my Windows Device name from "DESKTOP-OLD" to "DESKTOP-NEW", I put "DESKTOP-NEW". then clicked on "Next":

enter image description here

Then, clicked on "Restart now" to restart my Windows PC:

enter image description here

After that, I connected to MSSQL with my new server name "DESKTOP-NEW\SQLEXPRESS". *I use MSSQL Express edition:

enter image description here

Then, I clicked on "Properties" from the user "john" under "Security/Logins":

enter image description here

Then, I opened "Securables" page:

enter image description here

Then, I mistakenly checked "Grant" for my old server "DESKTOP-OLD\SQLEXPRESS" to grant the permissions for it, then clicked "OK":

enter image description here

But, I got this error below:

enter image description here

Attempt to retrieve data for object failed for Server 'DESKTOP-NEW\SQLEXPRESS'. (Microsoft.SqlServer.Smo)

ADDITIONAL INFORMATION:

Invalid Urn filter on server level: filter must be empty, or server attribute must be equal with the true server name. (Microsoft.SqlServer.Smo)

So, from "Search...", I added my new server "DESKTOP-NEW\SQLEXPRESS" to "Securables:" to grant the permissions for it, then clicked "OK":

enter image description here

But, I still got this error below:

enter image description here

So, are there any ways to solve this error?

0

1 Answer

Your MSSQL server name will still be your old one "DESKTOP-OLD\SQLEXPRESS" rather than your new one "DESKTOP-NEW\SQLEXPRESS". That's why you got the error and in the error, you can see the error hint message below:

ADDITIONAL INFORMATION:

... server attribute must be equal with the true server name.

So, to change your MSSQL server name from your old one "DESKTOP-OLD\SQLEXPRESS" to your new one "DESKTOP-NEW\SQLEXPRESS", first, with two SQL queries below, you need to check your Windows device name and your MSSQL server name respectively:

SELECT HOST_NAME() -- Get Windows device name SELECT @@SERVERNAME -- Get MSSQL server name 

Now, you could check your Windows device name "DESKTOP-NEW" and your MSSQL server name "DESKTOP-OLD\SQLEXPRESS" respectively as shown below:

enter image description here

Next, with the SQL queries below, you can drop your old MSSQL server "DESKTOP-OLD\SQLEXPRESS" and add the new MSSQL server "DESKTOP-NEW\SQLEXPRESS":

EXEC sp_dropserver 'DESKTOP-OLD\SQLEXPRESS' -- Drop server GO EXEC sp_addserver 'DESKTOP-NEW\SQLEXPRESS', local -- Add server GO 

Now, you could drop the old MSSQL server "DESKTOP-OLD\SQLEXPRESS" and add the new MSSQL server "DESKTOP-NEW\SQLEXPRESS" as shown below:

enter image description here

But, even if you check your MSSQL server name again, your MSSQL server name is still the old MSSQL server "DESKTOP-OLD\SQLEXPRESS" as shown below. *But no worries, in spite of that, the old MSSQL server "DESKTOP-OLD\SQLEXPRESS" is actually dropped properly and the new MSSQL server "DESKTOP-NEW\SQLEXPRESS" is actually added properly:

enter image description here

If you really want to check that the new MSSQL server "DESKTOP-NEW\SQLEXPRESS" is actually added properly, restart MSSQL with SQL Server Configuration Manager(SSCM). This is How to find SQL Server Configuration Manager in your Windows Machine:

enter image description here

Then, if you check your MSSQL server name again, your MSSQL server name is now the new MSSQL server "DESKTOP-NEW\SQLEXPRESS" as shown below.

enter image description here

Next, if opening "Properties" from the user "john" under "Security/Logins":

enter image description here

Now, you can see that your new MSSQL server "DESKTOP-NEW\SQLEXPRESS" is added to "Securables:" and your old MSSQL server "DESKTOP-OLD\SQLEXPRESS" is removed from "Securables:" as shown below:

enter image description here

Finally, you can grant the permissions for your new MSSQL server "DESKTOP-NEW\SQLEXPRESS" by clicking "OK" without error:

enter image description here

1

ncG1vNJzZmirpJawrLvVnqmfpJ%2Bse6S7zGiorp2jqbawutJobmxtYm5%2BdX6OmqutnZ2lwW7AzmapnqyinrK3sYydmK2ZXZu8s3nOm6Gem6Ris6K1y56bZp6fp3q0sdGvnKtlnZ6ws7vSqJ2tZaOmubSx0a%2Bc