SQL Server troubleshooting: Difference between revisions

From Yggenyk
Jump to navigation Jump to search
No edit summary
Line 18: Line 18:


==Repairing SQL Server database==
==Repairing SQL Server database==
. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf).  
. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf).<br>
 
# Open the database in SQL Management Server
# Find the database under Databases in the Object Explorer
# Rightclick the database and select: Tasks - Detatch...
# Delete the .ldf file so sequal server can't find it
# Select: File - New - Query with Current Connection
# Execute query: exec sp_attach_single_file_db 'TRACKMAN', 'C:\<path to database>.mdf'
# Rightclick the database and select: Tasks - Detatch...
# Rightclick the Databases and select: Attach... and attach the database again
 
* [http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/290f3875-2c73-4f73-8228-b3713cf7853b/ Database Recovery]
* [http://social.msdn.microsoft.com/Forums/en-US/sqldatabaseengine/thread/290f3875-2c73-4f73-8228-b3713cf7853b/ Database Recovery]
<google>ENGELSK</google>
<google>ENGELSK</google>

Revision as of 14:47, 16 January 2013

Reasons why SQL server installation will fail

A reboot is pending

If something else like a Windows update, ore another program that requires a reboot was installed before SQL server, and scheduled the rest of .dll replacements to happen during next reboot.
Reboot PC before installing SQL server, if it fails, try to reboot again and try once more.

Regional settings not is same as Windows language type

If Regional settings isn't same as Windows language type SQL server will fail to install.
If Windows is (US) the users Regional settings should also be English (US).
The same goes for other regioanl versions of windows.
FIX: If not set regional settings to same as Windows version install SQL server again.
After installing regional settings can be set back.

Username is the same as Computername

Repairing SQL Server database

. This error may indicate data corruption or that the log file (.ldf) does not match the data file (.mdf).

  1. Open the database in SQL Management Server
  2. Find the database under Databases in the Object Explorer
  3. Rightclick the database and select: Tasks - Detatch...
  4. Delete the .ldf file so sequal server can't find it
  5. Select: File - New - Query with Current Connection
  6. Execute query: exec sp_attach_single_file_db 'TRACKMAN', 'C:\<path to database>.mdf'
  7. Rightclick the database and select: Tasks - Detatch...
  8. Rightclick the Databases and select: Attach... and attach the database again

<google>ENGELSK</google>

id=siteTree