Link to home
Start Free TrialLog in
Avatar of donpick
donpick

asked on

Need script to detach and attach mdf and ldf SQL Server files

Running SQL SERVER 2000.

 There is one mdf and ldf file I want to detach and move and attach .
I have some experience with SQL server 2000 .

Let's call the mdf file A.mdf and the log file is Alog.ldf   The name for the sql server instance is 'A200'.

Could you please write  a simple script showing:
How to set A.mdf into single user mode.
How to detach A.mdf
How to attach A.mdf which is now in folder c:\A200Storage

Once the database A.mdf is attached, what commands will remove single user mode from A.mdf so it can be used by many users?

Thank you.
SOLUTION
Avatar of Qlemo
Qlemo
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of donpick
donpick

ASKER

Thank you all for your help.