Migrate SQL Server 2000 data to SQL Server 2008 - sql-server

I want to migrate 2 database from my old SQL Server 2000 to my new server with the 2008 version.
I do that with the Management Studio 2008 with the export data task. It works fine and no error occurs but in the database on my new server all primary keys are missing.
Did anyone knows why or has another idea how to solve my problem.

When you get to the Select Source Tables and Views step of the export wizard you need to do Edit Mapping for each selection, then select Enable Identity Insert. If you don't check this option the primary key values are not exported.

Related

Automation of SQL Server Migration with selective table truncation

Just wondering if any SQL Server experts out there have any tips that can help in my testing of a MS-Access port to SQL Server using the Migration Assistant and with selective Drop+Create SQL scripting.
I have a new SQL Server database that I'm migrating from a total of 5 external MS-Access databases. The one database gets changed daily and I'd like to update my test SQL Server with new data every once in awhile
My problem right now is that I don't want to Drop + Create the whole database.
I'd just like to selectively drop the tables being migrated in from the one MS-Access database.
I can't see an option for that inside SQL Server. Is there a tool or menu item that I missing?
I'm using SQL Server 13.0 (2017) and I have SQL Server 2016 Import/Export Wizard
Not sure if I'm missing something.
Create a SQL script, that you run before running the import.
-- Drop all tables imported from Access database x
DROP TABLE foo;
DROP TABLE bar;
-- etc
GO
To avoid typing all the table names, see e.g. list of tables without indexes in sql 2008
Or use MSysObjects in the source database.

MS Microsoft SQL Server Management Studio - Import/Export-Database with Default Value or Binding

I am using the Microsoft SQL Server Management Studio to clone a database and its tables and data (which runs a MS SQL Server 2008) to a new one (which runs a MS SQL Server 2012).
I know there is the possibility to do so with
"Tasks->Import Data"
and the transfer worked fine for the tables and the data of the tables. Sadly the old database also has set "Default Value or Binding"-Properties for some columns. These seem to have been lost during the transfer. Is there a way to tranfer these values as well?
Try to a create a "create script" for your source table and use that script to create your target structure. Then you can copy the data using the import wizard.

restore a sqlserver 2005 database into sqlserver 2012

I have a db running on an instance of sqlserver 2003, Ive tried to import it into sqlserver 2012 but that wont work it's says it's to old.
so I've imported it into sqlserver 2005, I have then backed it up again and tried to import it into sqlserver 2012 but it comes up with the same error.
I can restore other db's from sqlserver 2005 so I can only presume its keeping its 2003 settings when I back it up.
Can anyone help
I suspect that your database might have some deprecated functionality that prevents your upgrade from working.
There's a list of deprecated functionality between SQL Server 2000 and SQL Server 2005 on technet.
I would strongly advise you to use the SQL Server 2005 Upgrade Advisor to identify such functionality, and address any potential issues. Then, and only then you should have a database compatible with SQL Server 2005, and can (hopefully) proceed from there.
if u want database structure only then take database script then run into sql server 2005, if u want database with data also mean
right click the Database go task
click Generate Script
There Two options entire database or with specific objects
entire database for DataBase structure only
with specific objects - select all objects then click Next you find the Advance button then click it.
scroll down and Find Type of Data Scripts click and change to Schema and data then you will save as file file or new query window
this is one of the method to restore the database.
Set your compatibility level to (90) Sql server 2005 in your database properties after restoring.

Attach a .MDF file created by SQL Server 2008 in SQL Server 2000

I created a database in SQL Server 2008. I detached the database and I copied the .mdf over to the server, which is running SQL Server Enterprise Manager (SQL Server 2000).
When I try to attach the MDF I get...
Microsoft SQL-DMO (ODBC SQL State: HY000) Error 602: Could not find
row in sysindexes for database ID 13, object ID 1, index ID 1. Run
DBCC CHECKTABLE on sysindexes.
What does this mean? Is this because the db was created in a newer version?
From the documentation on the (I believe depreciated, but used in SQL Server 2000) sp_attach_db stored proc:
A database created by a more recent version of SQL Server cannot be
attached in earlier versions.
I think you'll have to script the schema and data of your database.
Pinal Dave has a good tutorial on how to do this here - just remember to make sure you choose the following settings:
Under General:
Script for server version: SQL Server 2000
Under Table/View options:
Script data: True
Remember to double check the settings for any others you might be interested in, such as foreign keys, triggers etc.
This is do-able, but you'd need to convert it to the SQL 2000 format before detaching it and attaching it on the old server. Here are the steps:
In entreprise manager, right click the database
Choose properties
On the left, click Options
Change the "Compatibility Level" to SQL Server 2000 (80)
Then save, and detach before reattaching on the old server.

Changing column properties in SQL Server database in SQL Server Management Studio

When I want to change column properties of an existing table in an SQL Server Express 2008 R2 database via the SQL Server Management Studio Express - it doesn't let me.
I can view the properties but they're all grayed out and I don't find anything to ungray it. I've just migrated from Access and I'm wondering whether this just isn't possible (there's already data in the table - I can however delete and create new columns) or whether I'm missing something.
Right click the table and choose "Design" instead of expanding the columns, right clicking the column and choosing "Properties".

Resources