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.setup > how to integrate a MDF file into sql server?
S'inscrire FAQ Membres Recherche Messages du jour Marquer les forums comme lus
ms.sqlserver.setup Questions about SQL Server.

how to integrate a MDF file into sql server?

Réponse
 
LinkBack Outils de la discussion
Vieux 29/09/2007, 16h36   #1
Bob
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut how to integrate a MDF file into sql server?

Hi,

i have a MDF sql server express database used by an asp.net application.
I would like to integrate it into Sql Server express.

In Studio Management, i rightclicked on Databases and i took 'Attach'. Now i
can see and manage that database from Studio Management, but it still refers
to the local path of the MDF file. How can i make it a full database of Sql
server?

Thanks
Bob


  Réponse avec citation
Vieux 29/09/2007, 16h54   #2
Jeje
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to integrate a MDF file into sql server?

does the MDF file exists on the local drives of the SQL Server server?

you can't attach a database which is on your drive into SQL Server running
on another computer.

so first:
copy the MDF and LDF files on the SQL Server server local drive.
do the attach process (you can select the mdf file from anywhere from a
local drive of the server)
click ok
and its done.
verify the security after you have attached the database.

is it what you do?

"Bob" <no@spam.ur> wrote in message
news:#3nXWYqAIHA.5328@TK2MSFTNGP05.phx.gbl...
> Hi,
>
> i have a MDF sql server express database used by an asp.net application.
> I would like to integrate it into Sql Server express.
>
> In Studio Management, i rightclicked on Databases and i took 'Attach'. Now
> i can see and manage that database from Studio Management, but it still
> refers to the local path of the MDF file. How can i make it a full
> database of Sql server?
>
> Thanks
> Bob
>

  Réponse avec citation
Vieux 30/09/2007, 11h37   #3
Bob
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to integrate a MDF file into sql server?

Thanks for replying.
I did all this, but when i do
select * from master..sysdatabases

in Studio Management, i still read as filename the local path
(c:\myapp\app_data) instead of :

C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mydb.mdf

So if i remove mydb.mdf from its local path, i have no access anymore to
that db.

The mydb.mdf is attached but not integrated into Sql Server.

You see what i mean?


"Jeje" <willgart@hotmail.com> schreef in bericht
news:CF4AFECA-38D1-433F-8252-F39C1F13316A@microsoft.com...
> does the MDF file exists on the local drives of the SQL Server server?
>
> you can't attach a database which is on your drive into SQL Server running
> on another computer.
>
> so first:
> copy the MDF and LDF files on the SQL Server server local drive.
> do the attach process (you can select the mdf file from anywhere from a
> local drive of the server)
> click ok
> and its done.
> verify the security after you have attached the database.
>
> is it what you do?
>
> "Bob" <no@spam.ur> wrote in message
> news:#3nXWYqAIHA.5328@TK2MSFTNGP05.phx.gbl...
>> Hi,
>>
>> i have a MDF sql server express database used by an asp.net application.
>> I would like to integrate it into Sql Server express.
>>
>> In Studio Management, i rightclicked on Databases and i took 'Attach'.
>> Now i can see and manage that database from Studio Management, but it
>> still refers to the local path of the MDF file. How can i make it a full
>> database of Sql server?
>>
>> Thanks
>> Bob
>>



  Réponse avec citation
Vieux 30/09/2007, 13h13   #4
Ekrem Önsoy
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to integrate a MDF file into sql server?

Hello Bob!


I think you made it like this:
-Stoped SQL Server service and copied your mdf and ldf files to "C:\Program
Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\" and restarted your SQL
Service.

You should go this way:
Connect to your SQL Server instance and then detach your database (mydb or
whatever). Move your mdf and ldf files (related to mydb) to their new
location which must be "C:\Program Files\Microsoft SQL
Server\MSSQL.1\MSSQL\Data\" I guess. And go to SSMS and attach your database
from the new path.

You should use detach\attach while moving databases, otherwise there will be
junkies of those databases in master database which is not good and could be
confusing later.


--
Ekrem Önsoy



"Bob" <no@spam.ur> wrote in message
news:OHtTKW0AIHA.3848@TK2MSFTNGP05.phx.gbl...
> Thanks for replying.
> I did all this, but when i do
> select * from master..sysdatabases
>
> in Studio Management, i still read as filename the local path
> (c:\myapp\app_data) instead of :
>
> C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mydb.mdf
>
> So if i remove mydb.mdf from its local path, i have no access anymore to
> that db.
>
> The mydb.mdf is attached but not integrated into Sql Server.
>
> You see what i mean?
>
>
> "Jeje" <willgart@hotmail.com> schreef in bericht
> news:CF4AFECA-38D1-433F-8252-F39C1F13316A@microsoft.com...
>> does the MDF file exists on the local drives of the SQL Server server?
>>
>> you can't attach a database which is on your drive into SQL Server
>> running on another computer.
>>
>> so first:
>> copy the MDF and LDF files on the SQL Server server local drive.
>> do the attach process (you can select the mdf file from anywhere from a
>> local drive of the server)
>> click ok
>> and its done.
>> verify the security after you have attached the database.
>>
>> is it what you do?
>>
>> "Bob" <no@spam.ur> wrote in message
>> news:#3nXWYqAIHA.5328@TK2MSFTNGP05.phx.gbl...
>>> Hi,
>>>
>>> i have a MDF sql server express database used by an asp.net application.
>>> I would like to integrate it into Sql Server express.
>>>
>>> In Studio Management, i rightclicked on Databases and i took 'Attach'.
>>> Now i can see and manage that database from Studio Management, but it
>>> still refers to the local path of the MDF file. How can i make it a full
>>> database of Sql server?
>>>
>>> Thanks
>>> Bob
>>>

>
>


  Réponse avec citation
Vieux 30/09/2007, 15h53   #5
Jeje
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to integrate a MDF file into sql server?

now I see...

SQL Server don't copy the database files into the default DATA folder.
Simply because SQL Server can access database store anywhere on the server
second because a DBA generally move the database to a different set of
disks.
it's why the attach process just attach the database from the location you
specify without moving the files.

a database is created in the DATA folder only when you CREATE a new database
WITHOUT specifying the storage folder.

the database is always "integrated" into SQL Server (using or not the DATA
folder is not important)

so if you want your database into the DATA folder, detach the database, move
the files into the DATA folder yourself and attach the database again using
the DATA folder instead-of the myapp one.

"Bob" <no@spam.ur> wrote in message
news:OHtTKW0AIHA.3848@TK2MSFTNGP05.phx.gbl...
> Thanks for replying.
> I did all this, but when i do
> select * from master..sysdatabases
>
> in Studio Management, i still read as filename the local path
> (c:\myapp\app_data) instead of :
>
> C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mydb.mdf
>
> So if i remove mydb.mdf from its local path, i have no access anymore to
> that db.
>
> The mydb.mdf is attached but not integrated into Sql Server.
>
> You see what i mean?
>
>
> "Jeje" <willgart@hotmail.com> schreef in bericht
> news:CF4AFECA-38D1-433F-8252-F39C1F13316A@microsoft.com...
>> does the MDF file exists on the local drives of the SQL Server server?
>>
>> you can't attach a database which is on your drive into SQL Server
>> running on another computer.
>>
>> so first:
>> copy the MDF and LDF files on the SQL Server server local drive.
>> do the attach process (you can select the mdf file from anywhere from a
>> local drive of the server)
>> click ok
>> and its done.
>> verify the security after you have attached the database.
>>
>> is it what you do?
>>
>> "Bob" <no@spam.ur> wrote in message
>> news:#3nXWYqAIHA.5328@TK2MSFTNGP05.phx.gbl...
>>> Hi,
>>>
>>> i have a MDF sql server express database used by an asp.net application.
>>> I would like to integrate it into Sql Server express.
>>>
>>> In Studio Management, i rightclicked on Databases and i took 'Attach'.
>>> Now i can see and manage that database from Studio Management, but it
>>> still refers to the local path of the MDF file. How can i make it a full
>>> database of Sql server?
>>>
>>> Thanks
>>> Bob
>>>

>
>

  Réponse avec citation
Vieux 30/09/2007, 19h11   #6
Bob
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: how to integrate a MDF file into sql server?

Thanks to both

"Jeje" <willgart@hotmail.com> schreef in bericht
news:EA77C444-89D9-4510-873C-3EA3B5031538@microsoft.com...
> now I see...
>
> SQL Server don't copy the database files into the default DATA folder.
> Simply because SQL Server can access database store anywhere on the server
> second because a DBA generally move the database to a different set of
> disks.
> it's why the attach process just attach the database from the location you
> specify without moving the files.
>
> a database is created in the DATA folder only when you CREATE a new
> database WITHOUT specifying the storage folder.
>
> the database is always "integrated" into SQL Server (using or not the DATA
> folder is not important)
>
> so if you want your database into the DATA folder, detach the database,
> move the files into the DATA folder yourself and attach the database again
> using the DATA folder instead-of the myapp one.
>
> "Bob" <no@spam.ur> wrote in message
> news:OHtTKW0AIHA.3848@TK2MSFTNGP05.phx.gbl...
>> Thanks for replying.
>> I did all this, but when i do
>> select * from master..sysdatabases
>>
>> in Studio Management, i still read as filename the local path
>> (c:\myapp\app_data) instead of :
>>
>> C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\mydb.mdf
>>
>> So if i remove mydb.mdf from its local path, i have no access anymore to
>> that db.
>>
>> The mydb.mdf is attached but not integrated into Sql Server.
>>
>> You see what i mean?
>>
>>
>> "Jeje" <willgart@hotmail.com> schreef in bericht
>> news:CF4AFECA-38D1-433F-8252-F39C1F13316A@microsoft.com...
>>> does the MDF file exists on the local drives of the SQL Server server?
>>>
>>> you can't attach a database which is on your drive into SQL Server
>>> running on another computer.
>>>
>>> so first:
>>> copy the MDF and LDF files on the SQL Server server local drive.
>>> do the attach process (you can select the mdf file from anywhere from a
>>> local drive of the server)
>>> click ok
>>> and its done.
>>> verify the security after you have attached the database.
>>>
>>> is it what you do?
>>>
>>> "Bob" <no@spam.ur> wrote in message
>>> news:#3nXWYqAIHA.5328@TK2MSFTNGP05.phx.gbl...
>>>> Hi,
>>>>
>>>> i have a MDF sql server express database used by an asp.net
>>>> application.
>>>> I would like to integrate it into Sql Server express.
>>>>
>>>> In Studio Management, i rightclicked on Databases and i took 'Attach'.
>>>> Now i can see and manage that database from Studio Management, but it
>>>> still refers to the local path of the MDF file. How can i make it a
>>>> full database of Sql server?
>>>>
>>>> Thanks
>>>> Bob
>>>>

>>
>>



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


É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,18177 seconds with 14 queries