Re: sp_attach_single_file_db

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance

From: Adam Machanic (amachanic_at_hotmail._removetoemail_.com)
Date: 06/17/04


Date: Thu, 17 Jun 2004 09:38:31 -0400

Rob,

You can put the MDF and LDF files wherever you want and attach them with
sp_attach_db. If you have the LDF file, you should not use
sp_attach_single_file_db (which is for MDF file only).

Just place the files in whatever directory you'd like, on whatever drive
you'd like, and run:

sp_attach_db 'DatabaseName', 'path_to_mdf_file', 'path_to_ldf_file'

"Rob" <anonymous@discussions.microsoft.com> wrote in message
news:1d83001c4546e$a5261a50$a301280a@phx.gbl...
> Hello:
>
> Is there a way to specify NEW file locations when using
>
> sp_attach_single_file_db
>
> You see the issue I have here is that, on one of my server
> where the DB was detached, the file locations for
> both .mdf and .ldf file exists on a drive letter that
> doesn't exists on the other server where I'd like to have
> this DB attached.
>
> I tried reassinging the proper drive letter and had also
> created the correct dir path, but to no avail.
>
> Any help would be appreciated. Thanks.



Relevant Pages

  • Re: How do I remove my development server log from my client site during login?
    ... How are you logging in and what tool are you using? ... The mdf & ldf files know nothing of the server they may have been attached to. ...
    (microsoft.public.sqlserver.setup)
  • Re: Removing SQL Instance Name
    ... copy off the mdf and ldf files to a safe location ... "Senthil" wrote in message ... I've the server as an instance. ...
    (microsoft.public.sqlserver.server)
  • Re: SQL 2005 express security issue
    ... Only if they then get hold of the MDF and LDF files and attach them to their ... instance of SQL Server - if you allow access to the underlying files then ...
    (microsoft.public.sqlserver.security)
  • Re: sp_attach_single_file_db
    ... This will attach the database to SQL Server ... > Is there a way to specify NEW file locations when using ... > both .mdf and .ldf file exists on a drive letter that ...
    (microsoft.public.sqlserver.server)
  • Re: SQL 2005 express security issue
    ... It is a local standalone application, ... Only if they then get hold of the MDF and LDF files and attach them to their instance of SQL Server - if you allow access to the underlying files then you're at risk no matter what software you use. ...
    (microsoft.public.sqlserver.security)