|
|
|
#1 |
|
Messages: n/a
Hébergeur: |
Hi,
When an attach is done inside management studio, as soon as we navigate to to the primary data file, all of the information for any secondary data files as well as log files is populated instantly. I would like to know if anybody knows how this information is gained from the primary data file. put another way my question could be, Given a primary data file that has been detached cleanly from an sql server 2005 db, how would I query it so that i would know all of the addiional files that would need to be attached also to make up a full database. my best guess is SMO - although EM does this as well - and I can't find an functions to do this. many hanks in advance. cheers Martin. |
|
|
|
#2 |
|
Messages: n/a
Hébergeur: |
I'm pretty certain that there's no-one that can read this information except the database engine.
According to Profiler, SSMS executes the undocumented command "dbcc checkprimaryfile" to get this information. Since it is undocumented, you would use it at your own risk... -- Tibor Karaszi, SQL Server MVP http://www.karaszi.com/sqlserver/default.asp http://sqlblog.com/blogs/tibor_karaszi "Martin" <martin_no_spam@hotmail.com> wrote in message news:u$PaPlF0IHA.5892@TK2MSFTNGP02.phx.gbl... > Hi, > > When an attach is done inside management studio, as soon as we navigate to to the primary data > file, > all of the information for any secondary data files as well as log files is populated instantly. > > I would like to know if anybody knows how this information is gained from the primary data file. > > put another way my question could be, > > Given a primary data file that has been detached cleanly from an sql server 2005 db, > how would I query it so that i would know all of the addiional files that would need to be > attached also to make up a full database. > > my best guess is SMO - although EM does this as well - and I can't find an functions to do this. > > many hanks in advance. > > cheers > > Martin. > |
|
|
|
#3 |
|
Messages: n/a
Hébergeur: |
Hi Tibor,
hanks for the reply. I'll have a play around with that procedure on a test database. cheers martin. "Tibor Karaszi" <tibor_please.no.email_karaszi@hotmail.nomail.co m> wrote in message news:eX0SmoG0IHA.4416@TK2MSFTNGP05.phx.gbl... > I'm pretty certain that there's no-one that can read this information > except the database engine. According to Profiler, SSMS executes the > undocumented command "dbcc checkprimaryfile" to get this information. > Since it is undocumented, you would use it at your own risk... > -- > Tibor Karaszi, SQL Server MVP > http://www.karaszi.com/sqlserver/default.asp > http://sqlblog.com/blogs/tibor_karaszi > > > "Martin" <martin_no_spam@hotmail.com> wrote in message > news:u$PaPlF0IHA.5892@TK2MSFTNGP02.phx.gbl... >> Hi, >> >> When an attach is done inside management studio, as soon as we navigate >> to to the primary data file, >> all of the information for any secondary data files as well as log files >> is populated instantly. >> >> I would like to know if anybody knows how this information is gained from >> the primary data file. >> >> put another way my question could be, >> >> Given a primary data file that has been detached cleanly from an sql >> server 2005 db, >> how would I query it so that i would know all of the addiional files that >> would need to be attached also to make up a full database. >> >> my best guess is SMO - although EM does this as well - and I can't find >> an functions to do this. >> >> many hanks in advance. >> >> cheers >> >> Martin. >> > > |
|
![]() |
| Outils de la discussion | |
|
|