Solved

How to add existing database to sql server 2012 express

Posted on 2013-06-28
6
437 Views
Last Modified: 2013-07-15
Have just installed minimal SQL2012 Express and need to attach an existing database to it.
This will be used in a small office with two workstations accessing data on sql2012 express server box.  

No IT dept - and just want a simple and easy way to administer system.

Need to know where to place the  MyData.MDF file and how to assign a database name such as MySqlData to it so i can use a connection string that specifies server MyPC\SQLEXPRESS and database name MySqlData

Also, what else do I need to allow client computers to access this database?

Lee
0
Comment
Question by:trims30
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
6 Comments
 
LVL 27

Expert Comment

by:Zberteoc
ID: 39284963
You should copy the .mdf file in the default location for the SQL server. To find that you open Management Studio and expand the Databases > System Databases node > right click on master > Properties > in left panel choose Files > in the right panel under Database Files scroll to right to see the column Path. Copy that path and then paste it in Windows Explorer and hit enter. Paste your .mdf in that location and then you can go through the attach process:

Right click on Databases node > Attach > click on Add button > choose the .mdf file from the location above > OK.

If you don't have the .ldf file you will have to remove it from the lower panel before you can complete the attach process.

After you attached the database you can right click on it > Rename > give it the new name.
0
 

Author Comment

by:trims30
ID: 39285658
Don't have Management Studio.  Just bare bones Server Express.
Data folder contains my mdf and ldf files.

Any way to get server to recognize data file without using Management Studio?
Would like to do a hands off data file install  at some time in future.
0
 
LVL 27

Accepted Solution

by:
Zberteoc earned 200 total points
ID: 39285748
Yes, there are SQL commands for this:

http://support.microsoft.com/kb/224071


Here you can download Management STudio for SQL express. It's free:

http://www.microsoft.com/en-ca/download/details.aspx?id=8961
0
NFR key for Veeam Backup for Microsoft Office 365

Veeam is happy to provide a free NFR license (for 1 year, up to 10 users). This license allows for the non‑production use of Veeam Backup for Microsoft Office 365 in your home lab without any feature limitations.

 

Author Comment

by:trims30
ID: 39285845
I really want a small - lightweight installer for the server.  Mgmt studio is 600mb just to add a database?

Just downloaded server with tools (720mb) and it's been installing for an hour so far and not done yet.
0
 
LVL 21
ID: 39285984
No IT dept - and just want a simple and easy way to administer system.

The easy way to administer  the SQL Server will be with the Mgmt studio. It can be installed on any PC on the LAN. It does not have to be on the same machine as the SQL Server. (SSMS)

FWIW: I have SSMS on my laptop. I can take it into ab office  and connect to their LAN. I then connect to their SQL Server.

Also, what else do I need to allow client computers to access this database?

See: Configure the Windows Firewall to Allow SQL Server Access
0
 

Author Comment

by:trims30
ID: 39326700
tHE CODE A T http://support.microsoft.com/kb/224071 WORKS FOR ME.
0

Featured Post

Percona Live Europe 2017 | Sep 25 - 27, 2017

The Percona Live Open Source Database Conference Europe 2017 is the premier event for the diverse and active European open source database community, as well as businesses that develop and use open source database software.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Using examples as well as descriptions, and references to Books Online, show the different Recovery Models available in SQL Server and explain, as well as show how full, differential and transaction log backups are performed
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…

628 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question