Pages

Showing posts with label MSSQL 2000. Show all posts
Showing posts with label MSSQL 2000. Show all posts

Monday, May 21, 2007

Restoring MS SQL Database From .mdf File

Imagine this scenario, you are planning to reformat your SQL server which has 50 databases and all data and log files stored in SAN system. What is the faster way to restore all the databases once you had finish installed the OS and SQL server? I used to backup one by one using the backup and restore database tool. But recently I found a faster way which could save lot of time.

The method is simple enough that I feel stupid not to know this. All you have to do is attach the .mdf file to the SQL Server. How? Open the SQL Server Enterprise Manager, open the tree (Console Root > Microsoft SQL Servers > SQL Server Group > (Your SQL Server) > Database) right-click on the database and select All Tasks > Attach Database. And then, just select the .mdf file, click OK and you are done. The process is almost instantaneous. So for 50 databases you could finish it less than 2 minutes.


If you're not sure what I'm talking about, you could always start with the default database ship with SQL Server. Right cilck on the Northwind database and select All Task > Detach Database
. After that follow the step above.

Good luck.

Friday, May 11, 2007

Snap-in failed to initialize in SQL 2000 MMC

I had this problem recently and this problem causing the Microsoft Management Console (MMC) for SQL 2000 fail to load all database. This is all caused by uninstalling MSSQL 2005 server which was at the same time has another version of MSSQL 2000 server installed. At first I thought the MSSQL is corrupted, however the database remain intact and accessible through SQL service or ODBC. So this must be something to do with MMC alone, and it was. Luckily the solution is simple enough.

All I have to do is reregistering the sqlmmc.dll located in the C:\Program Files\Microsoft SQL Server\80\Tools\Binn\

Just run this command

regsvr32 C:\Program Files\Microsoft SQL Server\80\Tools\Binn\sqlmmc.dll


That did the trick for me. There are lot of trouble related to MSSQL that I have not discovered yet, maybe I should take the MSSQL professional course.