Inserting data from SQL CE database into SQL Server 2008 R2 - sql-server

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

Related

Export SQL Server 2014 database (2008 compatible) in a backup file compatible with 2012

I'm a bit stuck with this scenario. My dev VM has SQL Server 2014 on it, and I've been working on a SQL Server 2008 database. The 2008 database is listed as '2008 compatible'. I now need to put this on a demo server which has an older edition of SQL Server (2012), and I find that 2008 compatible DBs don't create 2008 compatible backups (which I would have thought would be a given).
I'm actually trying to backup from SQL 2014 and recover into SQL Server 2012. How do I get a SQL Server 2008 or SQL Server 2012 compatible backup file from my 2008 compatible database?
Thanks.
You have to script the SQL database creation, in SQL Server Management Studio :
right click on the DB -> Task -> Generate script
From there a series off dialog to choose what to generate with the SQL command creation and where, in clipboard or file (recommanded for big DB), with optionally the data as some Insert Into SQL command. To find the data option click on the "Advanced" button and search for "Type of data to script"

SQL Server 2008 R2 Express cant connect to my editors

I'm using SQL Server 2008 R2 Express to edit my database. I can edit my database with query codes but there is a editor program which can help me to edit my database easily.
But when I'm trying to open this editor program, I get an error:
No SQL Server or there is no connection
In my opinion SQL Server 2008 R2 can't connect with this program basically. This editor program has an option.ini and I can write my database name and local.
Those editors were working for old SQL Server versions. But my database is suitable for SQL Server 2008 R2 express.

SQL Server - Copy database from Server 2008 to Server 2012

I have two servers one in Denmark the other here in the UK. I need to make a copy of a database out of SQL Server Management 2008 (1st server) and place it in SQL Server Management 2012(2nd server). I have tried connecting to the remote server but have been getting difficulties so instead of connecting both up and doing it that way I was hoping there is a function like copy database which could do this for me. I have gone into tasks and copy database in SQL Server 2008 but in the Copy Database Wizard that appears it says "You can use this wizard to move or copy databases from an instance of SQL Server 2000 or later to an instance of SQL Server 2008". I'm looking for something like this that will work for Server 2012.
Copy your database file .mdf and log file .ldf and paste in your SQL Server
Install file in Programs Files->Microsoft SQL Server->MSSQL10.SQLEXPRESS->MSSQL->DATA.
Open SQL Server. Right-click on Databases then Select Attach... option.
You can create a backup with the Management Studio on the source and restore it on the target.
You need Management Studio 2012 to make this step. You can then create empty database on 2012 server. Right click on this empty DB->Tasks->Copy database..
Wizard will guide you. You should to this under 2012 Management Studio because it is compatible with 2008 Server - vice versa it will not work.
Of course, cleanest way is to do this via backup (.bak file - Tasks->Backup.. then on 2012 server Tasks->Restore->Files or FileGroups) but you need remote access (RDP) to the server.

Convert /Attach SQL Server 2005 .mdf to 2008 .mdf?

I have SQL Server 2005 .mdf file and now I need to attached the same to SQL Server 2008
so how can I do the same.
Is any such tool is available , which convert 2005 .mdf file to 2008 .mdf file ?
As I do not have access to SQL Server 2005 at all .
Best practice is to backup the database using SQL Server Management Studio with SQL Server 2005, and then restore it on SQL Server 2008.
But you can simply attach the SQL Server 2005 .MDF file to SQL Server 2008. SQL Server will convert it for you - it is able to read data files from older versions of SQL Server.
I would suggest attaching to SQL Server 2008, performing an SQL Server backup, then restoring it back to SQL Server 2008. This will cause the database to be recreated, and will alert you to any data issues.
Cheers,
Peter
When you restore database backup(2005) to SQL Server 2008 , SQL Server restore your backup and update it's to new version. But SQL Server don't change compatible level of your database. you can change compatible level of your database by following query.
ALTER DATABASE test SET COMPATIBILITY_LEVEL=100;

VB.NET - Switch Network SQL Server 2008 R2 Database to a mobile SQL Server CE *.sdf File

I have developed a VB.NET program using a strongly typed dataset. This dataset has its connection to a SQL Server 2008 R2. The software should now be additionally used offline. The database should be exported to a *.sdf database. If no connection to the SQL server is produced, the software have to try to connect to the *.sdf database.
I would like to achieve:
1. Export the data in the SQL Server 2008 R2 database to a local *.sdf file.
2. This *.sdf file has to work as an alternate connection string in the strongly typed dataset.
How can I achieve this?
My SQL Server Compact Toolbox can help you with question 1. http://erikej.blogspot.com/2010/02/how-to-use-exportsqlce-to-migrate-from.html

Resources