Hai All,
I want to write down a stored procedure in a way that duplicates the database.I follow the below mentioned step in
order
exec <storedprocname> <sourcedb>,<destdb>
1.)Get <sourcedb> Data File Name
2.)Drop <destdb> if already available.
3.)Detach <sourcedb> databases
4.)Create <destdb>
5.)Detach <destdb> databases
6.)Copy <sourcedb> data file to <destdb> Data file
7.)Attach SourceDb DestDb Files using sp_attach_db /
sp_single_attach_db
But when this is executed i get the Error 5105 : Device not found. The physcial device %s is missing where %s is the log file name for Source/Dest.I searched in net and got to use sp_attach_single_file but that also proven to be not working for me. I do not want to use BACKUP & RESTORE commands for this operation.Can anyone pl enlighten me in this area?
Thanx in advance for all of your tips and guidelines.
Cheers,
Srinivasan Rajesh
I want to write down a stored procedure in a way that duplicates the database.I follow the below mentioned step in
order
exec <storedprocname> <sourcedb>,<destdb>
1.)Get <sourcedb> Data File Name
2.)Drop <destdb> if already available.
3.)Detach <sourcedb> databases
4.)Create <destdb>
5.)Detach <destdb> databases
6.)Copy <sourcedb> data file to <destdb> Data file
7.)Attach SourceDb DestDb Files using sp_attach_db /
sp_single_attach_db
But when this is executed i get the Error 5105 : Device not found. The physcial device %s is missing where %s is the log file name for Source/Dest.I searched in net and got to use sp_attach_single_file but that also proven to be not working for me. I do not want to use BACKUP & RESTORE commands for this operation.Can anyone pl enlighten me in this area?
Thanx in advance for all of your tips and guidelines.
Cheers,
Srinivasan Rajesh