Convert .sdf to .bak - sql-server

I'm trying to publish a webproject MVC3 .NET with binero.se. The problem is that my database file is .sdf. And binero wants a .bak file.
Does anyone know how to solve this problem?

.sdf is the file format for SQL Server Compact Edition and that's quite a different beast from "real" SQL Server. .bak is the database backup format for a full-blown SQL Server.
The way to get from .sdf to .bak would be:
create a temporary database in a "full" SQL Server (Express, Standard, Enterprise) with the name of the .sdf file
using a tool like SQL Server Compacst data and schema scripting, export your table structure and data from the SQL Server CE file into "full" SQL Server
once you've created all tables and other DB objects and inserted all your data into the "full" SQL Server database, create a backup of that database to get your .bak file

Related

Is it possible to create a .bak file via SQL Server Management Studio on Azure cloud hosting?

I need to create a .bak backup file of my SQL Server database on Azure hosting, because that's the only method which my new hosting supports for restoring a database.
Is this even possible to do? In SQL Server Management Studio, there is no "Backup" option under "Tasks" when I right-click on my database. The SQL Server edition is Standard, not Express.
You can't create .bak files in Azure DB. You will need to perform below steps at a high level to get a .BAK file
Create a .bacpac file for database in Azure
Import that .bacpac file to Local SQL Server and restore it
Now you can create a .Bak file on local SQL Server

Load SQL server backup file into DB2

Is it possible to restore/import a SQL Server 2008 database backup file (.bak) into DB2 10.1?
Thanks
Not possible; completely different format.
Restore to another SQL Server instance then migrate. IBM has resources for that. http://www-01.ibm.com/software/data/db2/migration/mtk/

get schema from .mdf database (sql server)

I have a .mdf (and .ldf) file for a SQL Server (I think express) database. I want to just see/export the schema of the database, but would rather not install the full SQL Server just for this, as it is a bit heavy. Is there some tool that can give me the data or even just the schema, preferably small and no install?

Inserting data from SQL CE database into SQL Server 2008 R2

I have a sample SQL CE database file (.sdf) got from another machine. But in my machine I do not have SQL CE. I want to read this data into a SQL Server 2008 R2 database. How can I do it?
Note: When I try to open (FileopenFile) the .sdf file using SSMS, it says “There is no editor available for ‘D\Samples\MyStore.mdf’. Make sure the application for the file type (.mdf) is installed”.
Thanks

Problem with importing an mdf created with SQL Server Express 2008 into SQL Server 2005

The question is probably extremely easy to resolve, but I need to resolve it because I need to carry on with my project. I am using SQL Server Express 2008 at home, and I've been working on an ASP.NET MVC app that stores my DB in an mdf file in the project's folder. The problem is that the SQL Server in the Uni labs is SQL Server 2005, and when I try to open the mdf file with the VS Server Explorer,It says that the version of the mdf file is more than the server can accept.
The only option that comes to my mind is exporting the DB as an sql file, just like I've done it thousand times with phpmyadmin. the thing is that the SQL Management Studio Express is not the most usable tool in the world, and for some strange reason all the articles I could find in Google were irrelevant. Please, help.
It is not possible to attach database created on SQL Server 2008 to SQL Server 2005. The other direction is possible.
Your only option is to script the database and data and run the scripts on SQL 2005. If you have used any of new features of the SQL Server 2008, you will have to rewrite the scripts.
I haven't used it much, but right click on database -> Tasks... -> Generate Scripts... / Export Data... / Import Data... should do the job right.
Google "Database Publishing Wizard", it's a tool from Microsoft to script an entire database, both schema and data.
you can script your db and its data. then run it on the target server to create a new db that is compatible with 2005 version.
Tools like Red-Gate SQL Compare and SQL Data Compare can compare a live database to e.g. a backup file, so you could compare your SQL Server 2005 database against the SQL Server 2008 Express backup file, and move data that way.
Or you could possibly generate INSERT statements for your tables that have changed data using a tool like this one here or this one here. These can generate INSERT scripts for your tables, which you can take along and run on your SQL Server 2005 target system.

Resources