About Me

My photo
I am an MCSE in Data Management and Analytics, specializing in MS SQL Server, and an MCP in Azure. With over 19+ years of experience in the IT industry, I bring expertise in data management, Azure Cloud, Data Center Migration, Infrastructure Architecture planning, as well as Virtualization and automation. I have a deep passion for driving innovation through infrastructure automation, particularly using Terraform for efficient provisioning. If you're looking for guidance on automating your infrastructure or have questions about Azure, SQL Server, or cloud migration, feel free to reach out. I often write to capture my own experiences and insights for future reference, but I hope that sharing these experiences through my blog will help others on their journey as well. Thank you for reading!

Invalid object name master.dbo.spt_values [solved]

Cannot find the object 'spt_values', because it does not exist or you do not have permission.





sometimes when you do right click on the SQL Server database and click on the property.
you encounter screen like this.


------------------------------

Invalid object name 'master.dbo.spt_values'. (Microsoft SQL Server, Error: 208)

If you will google this error, you will come across many articles.

In many blogs I found it is updated that  go ahead and execute u_tables.sql file from

C:\Program Files\Microsoft SQL Server\MSSQL14.<instanceID>\MSSQL\Install folder.

However, when you will try to execute this file, you will get an error like below.

Starting u_Tables.SQL at  22 Mar 2018 13:38:55:923
This file creates all the system tables in master.
Creating view 'spt_values'.
Msg 208, Level 16, State 1, Procedure spt_values, Line 7 [Batch Start Line 49]
Invalid object name 'sys.spt_values'.
sp_MS_marksystemobject: Invalid object name 'spt_values'
Msg 15151, Level 16, State 1, Line 62
Cannot find the object 'spt_values', because it does not exist or you do not have permission.
drop table spt_monitor ....
Creating 'spt_monitor'.
Grant Select on spt_monitor
Insert into spt_monitor ....
Finishing at  22 Mar 2018 13:38:59:417


okay, so How we will resolve this issue.

Resolution:- The Simple way to resolve this issue is...

1. Disconnect from the current session.
2. Take a DAC Connection for that instance. like below screenshot.
   ADMIN:<SQL Server Instance Name>


.3. Then in the DAC Connection execute that script (u_tables.sql) file.
    
  screenshot indicates script has executed successfully.
  



Now the said issue of  Invalid object name 'master.dbo.spt_values'. (Microsoft SQL Server, Error: 208) will get resolve.
You will be able to see the property of databases.



Thanks for Reading.