hi,
i have a strange requirement.
I have all the .mdf/.ndf/.ldf files for a given
database on different drives of same server.
I do not know which files put together make up the
database.
so in order to exec sp_attachdb or "create database
wit attach" syntax (files >16)
from where do i get the list of files pertaining to 1
db.
Can i access/read sysfiles system table in the .mdf
before attaching it.
any suggestion wud be welcome
Thanks
RahulIt's a reasonable requirement, but...
You'll have to keep track of the list of db files yourself.
You can't query a database file before it's attached.
However, if you haven't moved the files since they were detached, all you
need do is attach the primary datafile and it will find the other files (it
internally scans "sysfiles" during the attach to perform this).
"rahulnagarmath" <rahulnagarmath@.hotmail.com> wrote in message
news:2891001c39148$292d18c0$a601280a@.phx.gbl...
> hi,
> i have a strange requirement.
> I have all the .mdf/.ndf/.ldf files for a given
> database on different drives of same server.
> I do not know which files put together make up the
> database.
> so in order to exec sp_attachdb or "create database
> wit attach" syntax (files >16)
> from where do i get the list of files pertaining to 1
> db.
> Can i access/read sysfiles system table in the .mdf
> before attaching it.
> any suggestion wud be welcome
> Thanks
> Rahul
>
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment