[dba-SQLServer]Help - get db back

Stephen Hait shait at mindspring.com
Thu Nov 13 16:39:17 CST 2003


> I don't think so.  What I mean is that I have a pair of files called
> C2DbBilling.mdf and C2DbBilling_log.ldf.  It appears that these are
> the database files for my billing, though I am not certain.  I need
> to tell SQL Server to open these objects and display the data inside
> them.

If you have the mdf and ldf files, look into sp_attach_db in BOL

Example:
EXEC sp_attach_db @dbname = N'dbname', 
@filename1 = N'[path to db file]\dbname_data.mdf', 
@filename2 = N'[path to db file]\dbname_log.ldf'

HTH,
Stephen


More information about the dba-SQLServer mailing list