views:

47

answers:

1

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....

+2  A: 

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.

Dan Diplo
@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 ?
Nirmal
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`
abatishchev
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..
Nirmal
@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
@Dan Thanks buddy... It works for me !
Nirmal
@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..
abatishchev