2

I have created a set of tables (around 20) in SQL Server 2008 and entered around 1000 records to appropriate tables.

But the issue is that I want that same tables with all the entered data into SQL Server 2005 (SQLEXPRESS).

Obviously it won't work by taking a backup and restore it into SQL Server 2005 as it won't support backward compatibility.

Any suggestion would be appreciated....

1
  • And next time you will not develop on a newer database than the one you are using in pord. Commented May 26, 2010 at 19:48

1 Answer 1

2

If you've got Management Studio (including Express version) then you can export data from it (and target an SQL Server version). Try this:

  1. Right-click the database you wish to export and select Tasks > Generate Scripts

  2. Follow the wizard prompts and tick 'Export all objects'

  3. In the 'Script Options' dialogue look through all the options and change 'Script for Server Version' to 'SQL Server 2005' and also change 'Script Data' option to 'True' (this exports the DB content as well as the schema).

You can then save the export as an SQL script in a text-file that can then be run against the database you wish to import it into.

Sign up to request clarification or add additional context in comments.

5 Comments

@Dan Thanks for your reply... But how it can handle the auto generated ID fields in each table ? And how it will resolve the foreign keys ?
Consider that Generate SQL Server Scripts Wizard is crappy f** sh**!! It's seems that it has no changes since SQL 2000 and doesn't work in most of cases returning different errors like The specified network name is no longer available
I think its just generating the script for table structure.. But what if I want all the inserted records also into my MSSql 2005? Thanks..
@Nimal: Like I said, in the Options you need to select 'Script Data' to 'True'. @abatishchev: I've used the SQL Server scripts export wizard for many databases, including so very complex ones, and it has always worked flawlessly.
@Dan Diplo: You're lucky! I tried to use it several times for different databases - and every time it fails. I don't know why..

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.