Ok, can you open your services console and scroll down to S for SQL Server. You should now see the services. Please ensure SQL Server (SQLEXPRESS) is running and then try .\SQLEXPRESS instead of (local).
So as per your example:
Server type: Database Engine
Server name: .\SQLEXPRESS
Authentication: Windows Authentication
Hope this helps
Update: These instructions are because I assume you are running Express Edition not Dev/Std/Ent edition of SQL Server
Try ensuring the appropriate protocols are enabled:
- Start the SQL Configuration Manager (ie: Start->Programs->SQL Server->Configuration Tools)
- Expand the SQL native Client configuration
- Click Client Protocols (you may have a 32-bit and a 64-bit, apply to both)
- Ensure Shared memory, TCP/IP, Named Pipes are enabled in that order
- Expand SQL Server Network Configuration
- Ensure Shared Memory for either SQLEXPRESS and/or MSSQLSERVER is enabled
- Click SQL Server Services
- Restart any running services
You should now be able to login to the instance
If you find you cannot login at all you may need to follow these instructions to get SQL Server into single user mode. See here for the full instructions from Microsoft.
By default, sqlservr.exe is located at C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\Binn.
If a second instance of SQL Server is installed, a second copy of sqlservr.exe is located in a directory such as
C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\binn.
You can start one instance of SQL Server by using sqlservr.exe from a different instance, but SQL Server will start the version of the incorrect instance as well, including service packs, which may lead to unexpected results.
To avoid this, use the MS-DOS change directory (cd) command to move to the correct directory before starting sqlservr.exe, as shown in the following example.
cd \Program Files\Microsoft SQL Server\MSSQL10_50.1\MSSQL\Binn
To start the default instance of SQL Server in single-user mode from a command prompt
From a command prompt, enter the following command:
sqlservr.exe -m
Single-user mode can be useful for performing emergency maintenance when you do not want other users to connect to SQL Server, but any user can become the single user, including the SQL Server Agent service.
You should now be able to login to the instance and add yourself to the security tab and grant full access.
Alternate Method:
THere is a script here that claims to add the current user to the SQL Server sysadmin role. This may work in single user mode but I have not verified it
That assertion happens because the restore code read a page from the backup but the page is corrupt and the file ID stamped in the page header doesn't exist in the database being restored. It's firing from a code file called bckioreq.cpp (I used to own all this stuff while at MS).
The message to run DBCC CHECKDB is a generic message that doesn't apply in this case.
I take it you're restoring a full database backup and then a series of other differential and/or log backups? You're restoring on 2005, but are you restoring an older backup?
This is what's called a retail-assert in the code - there's absolutely no way to get around it - as soon as the code hits it, the assertion will fire and the restore bombs out. There's a Connect item to make this nicer but it's not fixed in 2008 either.
Is this happening on the full backup you're restoring or one of the subsequent differential and/or log backups? If the full backup, there's nothing you can do - that backup is toast. If one of the later backups, you can restore everything up to but not including that backup.
That's basically your answer I'm afraid.
Now, how did this happen? (rhetorical question) It could be that the database that was backed up was corrupt, or that the I/O subsystem corrupted the backup. Couple of things you can do to help protect against this - turn on page checksums in the database and use the WITH CHECKSUM option on your backups. This adds some checking to make sure what's being backed up isn't corrupt. You can also validate your backups in various ways - checkout my blog post on this: Importance of validating backups.
Hope this helps!
Best Answer
I would take a look at some of the links on google for repairing a corrupt master database.