check out master.dbo.sysaltfiles for file paths. then you can dynamically
create the detach/attach scripts using sysdatabases and sysaltfiles.
think like this:
select 'sp_detach ... ' + name + '
go'
from sysdatabases
I use such constructs all the time to create scripts to execute.

Signature
Kevin G. Boles
Indicium Resources, Inc.
SQL Server MVP
kgboles a earthlink dt net
> SQL Server 2000 Standard
>
[quoted text clipped - 11 lines]
> something
> new.
JosephV - 07 Mar 2008 19:54 GMT
Thanks. I'll research your suggestion.
> check out master.dbo.sysaltfiles for file paths. then you can dynamically
> create the detach/attach scripts using sysdatabases and sysaltfiles.
[quoted text clipped - 22 lines]
> > something
> > new.
Uri Dimant - 09 Mar 2008 13:39 GMT
Hi
http://dimantdatabasesolutions.blogspot.com/2007/03/detaching-and-attaching-data
base.html
> Thanks. I'll research your suggestion.
>
[quoted text clipped - 27 lines]
>> > something
>> > new.