In "most" cases YES ...
If you have both the MDF and LDF the command you would run in Query Analyzer(QA) would be ...
(NOTE: "MyDB" and "MyDir" are for example only ... you need to substitute these values for the names of your real DBs as well as the path they reside in)
EXEC sp_attach_db @dbname = N'MyDB',
@filename1 = N'c:\MyDir\MyDB_Data.mdf',
@filename2 = N'c:\MyDir\MyDB_log.ldf'
If you have an issue with this command failing and returning an error about the associated Log File(LDF), rename the log file(LDF) to something diffrent and then execute the following command in QA ...
EXEC sp_attach_single_file_db @dbname = 'MyDB',
@physname = 'c:\MyDir\MyDB.mdf'
It will probably return a message saying that this will create a new log file ... which is exactly what we want to do!
As a side note ... you really posted this question in the wrong forum. It should have been posted in the SQL Server Setup and Administration forum. There is also a MS SQL Server Programming forum too. Just a friendly FYI.
Please let us know the outcome of your situation.
Thanks
J. Kusch