Monday, June 21, 2010

Corrupt index(es) in msdb

I was trying to delete a SQL Job using sp_delete_job. It continued to fail with the message:
Unable to find index entry in index ID 1, of table {object_id of table}, in database 'msdb'. The indicated index is corrupt or there is a problem with the current update plan. Run DBCC CHECKDB or DBCC CHECKTABLE. If the problem persists, contact product support.
I found this blog post and the script in it repaired the msdb. 

(The command that fixed it is DBCC CHECKDB('msdb', REPAIR_REBUILD), but there is quite a bit of preparation that needs to be done before this command will execute successfully.  See the blog post I referred to.)

Thursday, June 17, 2010

LocalSystem, LocalService and NetworkService Accounts

Below are links to resources which help explain the difference between these accounts:

This one about "Understanding the Local Service and Network Service Accounts" was the most useful.

Click here for the MSDN article in this regard.

Tuesday, June 8, 2010

Cannot connect to a remote SQL Server instance using SSMS on a Windows 7 pc

I had the following problem: On my Windows XP pc I could use SQL Server 2008 SSMS to connect to our SQL Server 2005 production server, but when I tried to connect from my (newly setup) Windows 7 pc I got the following error:

Cannot connect to {SQL Server Instance Name}.

Additional information:
A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: SQL Network Interfaces, error: 26 - Error Locating Server/Instance Specified) (Microsoft SQL Server)

To resolve the problem I did the following on my Windows 7 pc:
* Opened Windows Firewall
* Opened the "Allow a program or feature through Windows Firewall" page
* Clicked "Allow another program..."
* Selected "SQL Server Management Studio" and clicked "Add". Only Domain was checked.
* Clicked "OK".