Creating a database from .mdf file in MS Access - sql-server

I have a .mdf which I need to import into MS Access. I have read that .mdf is a Sql Server format so Access wont recognize it. But is there some way I can get the database created in MS Access. I am using Access 2003 and Sql Server 2005

Why not right click the database in SQL Management Studio, click export and then specify the required parameter?
I just checked. Works in my installation of SQL Server 2008.

You could create a new Access database and import the tables from the mdf file into it. You have not mentioned the version of Access or SQL server so it's difficult to be more specific.
Alternatively, if you have access to an SQL Server, you can export the database as an Access .mdb.

Related

How to export local Visual Studio mdf database to format for Azure SQL database

I have been creating an application in visual studio using a local database in a .mdf (SQL Server) database file. Recently, I created an Azure account and want to export the local database (with its structure and data) so that I can use it from Azure to allow for online connections. Visual Studio doesn't seem to export the create scripts for the tables (including the table data). Really strange how there's no standard way of achieving this. Visual Studio should have a database exporting tool.
You can export the database as a BACPAC file, which includes both schema and data, and then import into Azure SQL Database. This can be done from the SSMS GUI, sqlpackage.exe CLI, or PowerShell. See these steps to export a database. The BACPAC can be similarly imported into your Azure SQL Database.
Another method is the Data Migration Assistant. See this MDA walkthrough. That tool also checks for compatibility issues during the process. Remember that to connect to a local database managed by Microsoft SQL Server, the name of the local server will be akin to: "(localdb)\V13.0". You will have to change the "V13.0" part to match the SQL Server version you are running. V13.0 Corresponds to Microsoft SQL Server 2017.

DataGrip open Microsoft SQL Server Database File

Is there way how to open Microsoft SQL Server Database File (.mdf) in DataGrip?
Please understand that unlike CSV/TSV, the .mdf file is MS proprietary format and should/cannot be readable by any software not developed by MS.
To access data using datagrip either export data in non-proprietary format like TSV/CSV or import the .mdf file to local sql server instance.
You can then connect to local sql server instance from Datagrip using this tutorial

Move MS Access tables to be used in SQL Server

I'm using MS Access 2013. I have a some tables which I would like to migrate to SQL Server 2012 (Management Studio). I want these tables to be used in SQL Server for addition etc., but I also want these tables to show as 'linked' in MS Access.
How do I make it so the tables look populated in MS Access, but are manipulated from SQL Server?
The Migration tool in SQL Server did not give me my desired results.
I'm not sure why you want to move it to SQL server from Access. If you say it is just for addition purposes, that is a really bad idea to move from Access.
You will need to create a shell database in SQL Server.
From Access select > External Data > More > ODBC Database and follow the prompts to export the data into SQL Server.
After that select > External Data under Import and Link > ODBC Database
This will link the local Access table to the SQL Server table and you will be able to run queries you require.
Create Database in SQL Server https://msdn.microsoft.com/en-us/library/ms186312.aspx#SSMSProcedure
Migrate Data from Access to SQL Server. For Access 2013 you will need to use the SQL Server Import and Export Wizard. Search the start menu for "Import and Export Wizard". It comes installed with SQL Server. For the data source choose Microsoft Access and follow the steps.
How do I make it so the tables look populated in MS Access, but are manipulated from SQL Server? Create a linked table via ODBC connection. https://support.office.com/en-us/article/Import-or-link-to-SQL-Server-data-a5a3b4eb-57b9-45a0-b732-77bc6089b84e

Importing a MDF file into SQL Server 2008?

I have inherited a VB.net web app that I'm making some changes on. I'm perfectly capable with the programming side (VB and MSSQL) but I'm getting lost with the tools. I was given a zip file of the code and everything. I opened the sln file in Visual Studio 2005 and it worked fairly easily with little modification.
Running the app works perfectly. Problem is, I need to write some new SPs so need the database admin. SQL Server 2008 Express is installed but it doesn't see any database and I have no idea how to import it.
I have a folder App_Data in the project with the file ASPNETDB.MDF. Opening this in VS gived the error:
This server version is not supported. You must have Microsoft SQL Server 2005 Beta 2 or later.
Any ideas where to go from here?
You need to get Sql Server Management Studio. From there you should be able to connect to the instance of Sql Server Express running on your system and tell it to attach to the .mdf file. This will allow you to use that database from withing sql server and management studio, and you will be able to add your stored procedure. Just remember to detach again when you're done, or you won't be able to use the mdf file as you expect from your app.
Visual Studio uses SMO 2005 to connec to to SQL. The SMO 2005 will not connect to SQL 2008 by design. You need to either upgrade VS to VS 2008, or downgrade Express to Express 2005.
You can't attach mdf file made in SQL Server 2005 to a SQL Server 2008 instance. What you need is to install SQL Server 2005 Express, attach this file, backup database, then restore it on 2008 Server instance and detach the database. You will get properly created for 2008 Server mdf.

can i view aspnet.db in sql server 2008 management studio

i have just started playing aorund with asp.net mvc and i want to view the database (aspnetdb.mdf) in sql server 2008 management studio
but it doesn't seem to let me view this file.
any suggestions?
You have to attach the database to the SQL Server instance using CREATE DATABASE FOR ATTACH or sp_attach_db, and then connect to the instance with SQL Server Management Studio to view the contents of the database. I am assuming that you are using SQL Express, which would mean that your application is configured to use User Instances where the connection string attaches the database to the SQL Server during code execution. This isn't a optimal way of doing things performance wise since you have to pay the cost to bring the database online repeatedly. If you attach the database permanently to the SQL Instance you will need to change the application connection string because the database can only be attached once since SQL Server takes an lock on the file to prevent it from being changed by another process.

Resources