PHWinfo banniere

Titres
PORTAIL ANNUAIRE ARTICLES COMPARATEUR HÉBERGEURS DEVIS FORUMS RÉDUCTEUR D'URL
Précédent   PHWinfo > Forums Hébergement > Forum Hébergement serveur > ms.sqlserver.server > query detached mdf file
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
query detached mdf file

Réponse
 
LinkBack Outils de la discussion
Vieux 17/06/2008, 11h05   #1
Martin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut query detached mdf file

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.

  Réponse avec citation
Vieux 17/06/2008, 13h06   #2
Tibor Karaszi
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: query detached mdf file

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.
>



  Réponse avec citation
Vieux 17/06/2008, 20h53   #3
Martin
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: query detached mdf file

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.
>>

>
>


  Réponse avec citation
Réponse


Outils de la discussion

Règles de messages
Vous ne pouvez pas créer de nouvelles discussions
Vous ne pouvez pas envoyer des réponses
Vous ne pouvez pas envoyer des pièces jointes
Vous ne pouvez pas modifier vos messages

Les balises BB sont activées : oui
Les smileys sont activés : oui
La balise [IMG] est activée : oui
Le code HTML peut être employé : non
Trackbacks are oui
Pingbacks are oui
Refbacks are oui


Fuseau horaire GMT +1. Il est actuellement 00h32.


Édité par : vBulletin® version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC5 Tous droits réservés.
Version française #16 par l'association vBulletin francophone
PHWinfo est un site Éducation Sans Frontières ©2000-2008
Ad Management by RedTyger
©Tous droits réservés par les parties respectives
Page generated in 0,10141 seconds with 11 queries