Get content from mdf file / Import to Excel - database

I have a .mdf file (some GB) that contains data from an old application. However I need to work with some information that is stored in this database. Different to similar questions I have not developed this application, I do not have a SQL Server running, I just have the file.
I already installed MDF Viewer (http://www.sqlmdfviewer.org/) and I can see the information that I need there in two tables but this tool can really only display the content, it is not possible to export or even copy/paste.
I have also installed SQL Server Management Studio Express as this software was mentioned in other questions but if I want to open the mdf file I get an error "The operation could not be completed".
Is there some tool like MDF Viewer that can also export the content of a table? Excel, CSV, ... something that I can read and work with?

Related

dacpac file Publish error to LocalDB: "The element cannot be deployed. This element contains state that cannot be recreated in the target database."

Pretty simple you would think, but as I cannot edit the schema in this database I have no idea how to get past this error when I am publishing my dacpac file to my local database. I am trying to take a copy of a database that is hosted in Azure and have it locally for my own development purposes. I am not a sysadmin of the database, but I have complete access to it other than that. It is a production database so I can't mess anything up for obvious reasons.
I had a hell of a time even getting this dacpac file created in the first place. I was getting far more errors/warnings when trying to export as a bacpac file with data (which is what I really want to do, but I can worry about that later).
Here is the command I am trying:
SqlPackage.exe /Action:Publish /SourceFile:" C:\Data\opkCore.dacpac" /TargetConnectionString:"Data Source=(localdb)\MSSQLLocalDB;Initial Catalog=opkCore; Integrated Security=true;"
This is what I used to create the dacpac file:
sqlpackage.exe /Action:Export /ssn:tcp:<MyDatabase>.database.windows.net,1433 /sdn:opkCore /su:<MyUserName> /sp:<MyPassword> /tf:C:\Data\opkCore.bacpac
I have tried other solutions such as:
Export Data-tier Application, but I am limited to only doing it in an Azure container and I am not in control of that. It is a Pay-As-You-Go model which does not support blob storage apparently
Copy Database only works for 2005 and earlier and this is SQL 2019
Deploy Database to Microsoft SQL Server Azure SQL Database
Import Data-tier Application, same problem as #1
Exporting bacpac file using SqlPackage.exe - Errors all over the place that I cannot fix. The database is not mine to mess up
I CAN export tables one at a time, but then I am missing certain bits of schema that work together, so I get errors there also.
I really should be able to just get a local copy of the database in the EXACT same state that it currently is on our production server. Any other ideas for me on how I can do this that will ignore problems with the database and just get me a local copy the EXACT way the database is in production? 3rd party tools that do this or anything?
I decided to just script all the tables and run the script on my new DB. There were a lot of errors, but it did what it could which was 99.99% of the database schema and that is good enough for my purpose. Maybe I will try to get the data exported and imported as well.
EDIT: To export the data I just used SSMS Export data and the destination used was the new LocalDB database I just created from the scripts.

How to read an old Jet 3.5 database?

I am trying to investigate an old DB file that used to have a custom front-end that dose not work anymore because of corrupted files.
The only clue I got is that it uses an old driver, a DAO Jet 3.5 (I have the driver installation file), and it used to run under windows XP.
The DB file itself doesn't have a known file extension.
What are my options for manually exploring the database?
If the file has no extension, it might not be a Jet database. But assuming it is, there are a few options...
MS Access would be the most obvious thing to try, but it can fail on old enough database files.
An alternative is MDB Viewer Plus which can open and read very old MDB files, with a nice GUI. It is perfect for "manual exploration" of an MDB file.
http://www.alexnolan.net/software/mdb_viewer_plus.htm
MDB Viewer Plus is a freeware viewer plus editor for opening Microsoft
Access MDB and ACCDB database files. It does not need to be installed
to run. It uses Microsoft Data Access Components (MDAC) which is
installed as part of Windows.
MDB Viewer Plus has been written to provide a free, quick and easy way
to open, view, edit, filter, sort, import to, export from, modify and
search MDB and ACCDB files. This is useful for software developers
like myself who use Access databases as a backend database for their
bespoke software. MDB Viewer Plus provides a convenient way to view
and edit these databases.

visual foxpro for windows 8

I have foxpro data table files ".dbf",".fpt",".cdx" .
I want to read data in the files and import it to SQL server 2008
I have windows 8 OS installed on my machine. I could not find compatible visual foxpro version for windows 8.
Also I have used dbfviewer tool to view data in .dbf file but I cannot check data in .fpt file
Any help is appreciated.
I don't know why people want to close an legit question... My guess they have no clue.
I am running windows 8.1 and use VFP 9 regularly. It may not claim to be directly compatible because M$ has discontinued support on the product, so why even test on platforms they have no concern with. Have you tried VFP9?
Another approach some people use is downloading the VFP OleDb Provider and use it via .net, or even through SQL-Server to use a connection, query the raw data into SQL Server, then run through conversion techniques while everything IS in SQL server.
VFP 9 also has from its top-level menu
Tools --> Wizards --> Upsizing
and guides you through how to pick either a directory of free tables, or pick a database and identify which server to connect to, etc, etc.
Hopefully some good starting points for you to run with and check back if you get stuck somewhere else down stream...
You only need to worry about the DBF file.
As noted in Microsoft's online documentation, Visual FoxPro's DBF, FPT, and CDX files are "Table", "Table Memo", and "Compound Index", respectively.
The DBF is the "core" file, containing the description of the fields as well as the information about each record and the actual data for most data types. For FoxPro's memo-style data types, the information for each record is written onto the equivalent FPT file instead of the DBF itself.
The CDX is a record of the FoxPro indexes, and rather that containing data just contains compiled and ordered pointers to which records match which indexed expressions.
You could purhcase a copy of Visual FoxPro 9, as it seems to work on Windows 8 albeit with some quirks. However, if you only want the data and do not have an exist VFP license, you are better off using the free OLE provider DRapp mentioned in his answer, and sending your data to a more modern format.
You can also use DBF Commander Pro to export DBF files to SQL Server.
To carry out this operation, you'll only need DBF and FPT files - they contain data of Memo field(s). CDX files are not needed since VFPOLEDB provider doesn't support indexes at all.
Install the app, open a DBF file, click File -> Export to DBMS. Then provide the connection string (or Build it). For MS SQL Server 2008 it will look as follows:
Provider=SQLOLEDB.1;Persist Security Info=False;User ID=userid;Initial Catalog=databasename;Data Source=servername
Click Connect button in order to check the connection, then choose the destination table from the dropdown list:
At the bottom of the window you'll see the command-line that can be used for uploading DBFs to a database in a batch mode. Click Export button to start the process.
DBF Commander Pro has 20-days full featured trial period, so you can do the job for free and you'll economize $300 on Visual FoxPro license :)
In Windows 7, I can create an ODBC connection to a Foxpro data source. I don't know if that capability still exists in Windows 8, but I don't see why it wouldn't.
Once that connection exists, the data becomes available for any other tool that can utilize ODBC. At that point, you could import the data into Excel, massage it, then load it into SQL Server. Alternatively, you could also access the data directly via VBScript to either dump it to a text file or import it directly into SQL Server.

Sharing source for an ASP.NET MVC project that has a database

I have a very simple database (just 3 tables and a dozen rows or so each) that is designed for use with an ASP.NET MVC 5 project. I am using Visual Studio 2013 Ultimate.
I want to be able to post my Visual Studio solution for others to download and learn from. These examples will often be Visual Studio ASP.NET MVC solutions that appear in my blog. I've successfully publish console-type applications but I've never published any applications that use a database.
In my current project, I'm using a connectionstring that begins with "Data Source=(localdb)\v11.0". What I don't understand is how to provide a copy of my existing database to my reader. Is it a physical file on disk? If so, where is it (it doesn't appear as a path in the ASP.NET/MVC-provided default connectionstring) and how can it be included in a downloadable Zip file for others to easily download and install? Does NuGet or GitHub somehow automate this process? For the records, I googled around and also didn't find any articles that discuss how to do this (admittedly, I used the search terms "share" and "database" and saw a lot of hits having to do with network sharing--not what I intended...).
Finally, if at all possible I want my users to be able to download the solution/project files and run the project successfully right away. I don't want them to have to go into web.config and edit connectionstring or other system/configuration/environment values.
There is no information on what type of database you are using ? i.e. (SQL SERVER / My SQL / Oracle)
Would share you on SQL Server and to share your Local Project with Database. There are two ways through which you can share Project (including database).
Share the BAK file with Project - Take Backup of your project and include the same in the Project ZIP file and upload. So if any user downloads it then it will restore the BAK file (Database file) and then can connect down project with database.
Share the Physical file (MDF and LDF) with Project -
(a). By default, MDF and LDF files are located in SQL Server >> MSSQL >> Data
(b). Concerned database MDF file should be taken and added in ZIP file (c). Person downloading will extract the file and Use SQL Management Studio >> Database >> "Restore Files and Filegroups" option (d). Restore the database and run the project

Converting .BAK file of SQL Server DB to .CSV

Ok so I have a .bak file which is a backup of our old CRM data. This has come from a backup of an SQL SErver database (not sure what version). What I am trying to achieve is converting all the data that file contains in a .CSV that I can then use to import the data into a different CRM.
I have tried the obvious things, renaming the file .csv and trying various text editors and applications that claim to be able to view these kind of files. All I ever get is a ton of gibberish, by that I mean a ton of characters and symbols that clearly do not represent what is in the data backup.
From what I have obtained already, I need to restore this file to an SQL Server database, and then do the export to .csv. I have managed to set up a trial version of SQL server 2012, however when I try to import the file (import from flat file option), when I get to the preview, it appears to just be gibberish populating the fields again, and if I then run that anyway, its fails and returns errors. I can confirm that another CRM company had managed to restore this and extract what they needed, sadly we decided not to continue with them, but based on that, I would say the .bak file is not corrupted.
I assume I am doing something wrong. My question is what is the correct way to import / restore a .bak file into MS SQL 2012?
Is there an alternative that I have missed or is this not the right approach to begin with?
Any help greatly appreciated as always!
I recently needed to convert a MS SQL Server database backup in .BAK format to anything digestible by other tools such as CSV, SQL. The only thing I found was online converter RebaseData. It's free for smaller file sizes, up to 10MByte.

Resources