IBM Computer, Laptops and Servers

Back Homepage Content Directory Resource Guide Blog

Why do I get errors about master..spt_values?

You may see this error in an ASP page: 
 
Microsoft OLE DB Provider for SQL Server (0x80040E37)  
Invalid object name 'master.dbo.spt_values'. 
/<file>.asp, line <line>
 
Or in SQL Server: 
 
Server: Msg 208, Level 16, State 1, Line 1 
Invalid object name 'master.dbo.spt_values'.
 
Make sure you are connecting with a valid user. If you are connecting with a non-privileged user, you may not have access to the table. If you are connecting as sa, try to connect as an administrator via Windows Authentication (trusted connection), and vice-versa. 
 
If you are getting this error while attempting to use Enterprise Manager to connect to your server, then there may be a more serious problem than permissions. See if you can connect with Query Analyzer, again trying both sa through SQL Server authentication and an administrator account using a trusted connection. The result of this will decide your fate: 
 
If you can connect with Query Analyzer 
 
Execute the following command: 
 
USE MASTER 
GO 
DBCC CHECKDB 
DBCC NEWALLOC 
DBCC CHECKCATALOG
 
If these report errors, you may have to rebuild the master database (see the bottom section of this article). Otherwise, you can assume that the database itself is okay, and perhaps someone deleted or renamed the spt_values table. So execute the following: 
 
USE MASTER 
GO 
DBCC CHECKTABLE('spt_values')
 
If this reports any errors, you might try re-installing the latest service pack. If you're not at SP2 or SP3 already, you really should be doing this anyway.  
 
Barring that, in the INSTALL folder of the latest service pack, there is a file called U_TABLES.SQL - you can pull out all of the entries that involve spt_values and run them (an IF EXISTS DROP / CREATE TABLE, two CREATE INDEX statements, a GRANT SELECT to PUBLIC, and many INSERT statements). 
 
If you can't connect with Query Analyzer 
 
You can try the following from a command prompt, given the correct path to the latest U_TABLES.SQL file: 
 
osql -E <path>\U_TABLES.SQL
 
If this doesn't work, there is a relatively serious problem. Your options are to rebuild the master database using the rebuildm.exe utility--see the topic 'Rebuild Master' in Books Online or in these MSDN articles: 
 
    Rebuild Master 
 
    How to rebuild the master database (Rebuild Master utility) 
 
Or, to reinstall SQL Server. If you choose to reinstall SQL Server, make sure to detach all user databases first, or you may lose your data. You will also need to re-create any user-defined types that have been placed in master, msdb, tempdb, etc.

[ Comment, Edit or Article Submission ]

Share this:

Add To Yahoo MyWeb Add To Google Bookmarks Add To Furl Fav This With Technorati Add To Newsvine Add To Bloglines Add To Ask Add To Windows Live Add To Slashdot Stumble This Digg This Add To Del.icio.us Add To Reddit

More about:

Sep October 2008 Nov
Sun Mon Tue Wed Thu Fri Sat
      1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31  

IBM Computer, Laptops and Servers Blog on Technorati Related Blog of IBM Computer, Laptops and Servers on Sphere
Content Directory
Resource Guide


PCIQ Computer Repair and IT Support for PC and Mac

Website Links
IBM Computer, Laptops and Servers Copyright © 2008 www.ibmfans.com. All rights reserved. Site Map
Homepage | Blog | Advertise | Privacy Policy | Disclaimer | Contact Us | Links