How do I import data in the Database.mdf file into a SQL Server? I am using RazorSQL to access the MSSQL database, and tried to "import" the data, but did not know which "separator" to use.
I presume that my DotNetNuke data is in the Database.mdf file since WebMatrix was running locally and the web.config files references it.
I have an LDF file as well.
Using WebMatrix Migrate is not an option. This is a manual procedure I am looking for.
Open up SQL Server Management Studio and connect to your database server.
Then follow these steps:
Attaching a MDF file
Attaching an MDF file without LDF
This will get your database into SQL Server then you can export the data or do whatever you want with it from SQL Server management studio.
Related
i have a .bak file and i want to check its data before importing it to host ! i tried to open it with MS SQL server management studio to see data inside the backup file. i googled a lot but i couldnt understand how to open this file ! i saw every solution to import a .bak file in a existed database ! i have no database on my local computer. how can i check my backup file data ? anyone can help ?
thanks in advance !
There are some 3rd party tools. Try searching google for "open bak file without sql server".
Also there is free SQL express, so you can install server on your local computer and attach database. Default installation should do the trick.
You can even open it in notepad, but it's not very practical..
I found links to this topic on this and other sites but have had no luck. I know a lot of code but I am REALLY out of my wheelhouse here so please provide very specific instructions if possible.
I would like to import this SQL Server .MDF database file (200 MB) into Access tables (or link to the external SQL Server tables, so that I can transfer the data within Access).
I installed SQL Server Management Studio (thought I needed to) but cannot figure out how to get it to connect to the DB... then I think I would need to use the external data ODBC option in access to connect from there but I haven't been able to get anything to work...
This is a one-time need so any creative workaround would be acceptable also...
Any help that you can provide would be greatly appreciated. Thanks!!
Install SQL Server Express With Tools (2012 should be fine).
When you install this, include the following features:
Database Engine and Management Tools - Basic.
Once you have this installed, open SQL Server Management Studio (Run > ssms.exe).
As marc_s said, you'll need to attach the .MDF file to your SQL Server.
I usually copy the MDF file to C:\Program Files\Microsoft SQL Server\MSSQL11.SQLEXPRESS\MSSQL\DATA so when I attach the database, it's the first folder that's open.
Next, in Access 2013, use the Data Import wizard to connect to SQL Server. You'll need to enter the SQL Server name and instance, usually "localhost\SQLExpress" works for a default SQL Express install.
Follow the Wizard, and it'll allow you to pick which tables/views you want to use.
You can also do this in Excel first, then save the data as .csv or something similar, then import the CSV into Access.
I know we can write a Stored Procedure/Bulk Insert to read the files that are located on the same Windows Server as SQL Server and update the database but not sure how to do it when the files are present in LINUX.
Any help would be greatly appreciated
Assuming you can access those files through some network file share, SSIS would likely be the tool to use. If It's just a 1-time or ad-hoc occurrence, the SQL Server Import and Export tool would likely be the easiest solution.
why sql server 2005 so sucks?
i should work on an old system that using sql server 2005!
my problems are :
1-when i detach a database and move mdf / ldf files of that db to another drive , so i can
not attach these files because of moving!
what is the best way for change the location of mdf/ldf files to another drive?
==============================================================================
2-when i backup a db that mdf/ldf of that db are on drive e , so i can not restore that bak file to another system that has not drive e / what is going on about sql server 2005 / i test this job on sql server 2008 and every thing was ok / how can i solve this issue?
i am using windows 7 ultimate / sql server management studio express edition /
thanks in future advance
best regards
When you restore a database backup you need to go into the restore options and update the paths of the MDF/LDF files to wherever you want them on the new machine. The default is to keep these paths the same and obviously they may not exist on the new machine.
When you did the restore, you pointed the data and log files to the new drives - you may have done this in the GUI (Management Studio) or in TSQL. When you try the reattach, you need to do the same thing - just change the file locations.
Firstly you take the backup of SQL database including Log transaction files also. Then detach it by right clicking on it. Now you can change the location of MDF file and then restore. it.
I am doing a project of a web enabled database. I have created the database file in my PC.
Now when I just want to open .mdf i.e. of the database I created, I cannot open it in other PC. I even had copied the .ldf file i.e the log file to that PC.
Since I need to transfer the database to the Server later, I don't know how I will dump the database in that server from my PC so that the company can use it.
The basics of using mdf file is like this:
Create a new database using SQL Server (set the path for the file as you wish)
If you wish to move the file elsewhere,
detach the database from your server
copy/move the file to wherever you wish
attach the file as database in SQL server
You are not supposed to open the file by double-clicking as mime setting or attachment of extensions migh not be there in the target machine.
Why don't you use the decent method to copy/move database?