I assume you had to rebuild a system and reinstall SQL Server. I also assume that you don't have SQL backups but do have the MDF and LDF files. If this is so try the following.
1- If you haven't installed SQL Server do that first.
Make sure you place the data files in the same drive and directory as the previous installation.
2- Backup the master, msdb, and model databases.
3- Stop the SQL Server service.
4- Backup the MDF and LDF files for master, msdb and model databases.
4- Copy the MDF and LDF files for your databases, including master, msdb and model, into the SQL data directory.
5- Restart SQL Server.
If you are lucky, SQL Server will start and your databases will be available. However, SQL may fail to start for a number of reasons. If it does fail do the following.
6- Restore the MDF and LDF files for the master, msdb and model databases that were created with the new installation of SQL Server.
7- Restart SQL Server.
8- Add all your logins.
9- Use the sp_attach_db stored procedure to attach your user database.
10- Use sp_change_users_login to verify the logins and users match. The SP is documented in books online. You can also read an article about fixing broken logins at
Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.