Solved

Primary key lost when exporting the data

Posted on 2002-03-08
8
614 Views
Last Modified: 2011-09-20
Hi Experts

I have a database on my local server and an another database on my isp side. To run my web sites i have to upload the data to my host isp. I have only the export and import rights. The problem is that i have primary keys in my tables on my local database. The movement i export the data to my isp server all the primary keys are lost. I tried the similar thing by exporting data to an another local server. The result is same. Is this a big bug in the sql server or there is any way to solve the same. Remember i donot have the rights to take the backup of the database or restore it.

With Regards

Loveneesh Bansal
0
Comment
Question by:loveneesh_bansal
  • 4
  • 3
8 Comments
 
LVL 4

Expert Comment

by:ruperts
Comment Utility
I haven't tried this, but I assume that you have the IDENTITY property on for the primary key field.

You'll have to turn it off for the insert on the target machine, and then afterwards (if needed) put it back on again.
0
 
LVL 2

Expert Comment

by:UncleMatt
Comment Utility
how are you importing the data?

if you are using DTS there is a set identity insert on option when you select the tables i believe.

if you are using linked servers and doing it that way then use:

set identity_insert on

Matt.
0
 
LVL 1

Author Comment

by:loveneesh_bansal
Comment Utility
dear UncleMatt i have tried the same but still the result is same. I suppose it is a big bug in sql server .

loveneesh
0
 
LVL 2

Expert Comment

by:UncleMatt
Comment Utility
i've done this same thing myself, so it's not a bug in the server, what versions of SQL Server are you using, are they both the same.  

If you are using DTS what options are you setting.

let us know more information and i might be able to help.

Matt.
0
Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

 
LVL 1

Author Comment

by:loveneesh_bansal
Comment Utility
Dear Unlcematt

I am using sql server 2000. To test the things i had created two database. In the first database name as test i had made a table name as one. Under this table i have only one field name as id. This is the primary key. Now hen i used the enterprise edition of sql server and from the second database i import this table. When i saw the design from this database the primary key was not there.

Please help me for the same.

loveneesh
0
 
LVL 2

Accepted Solution

by:
UncleMatt earned 15 total points
Comment Utility
when you setup the dts package, there is a choice that i can't remember all of, but the bottom of the three cohoices is something like transfer objects between sql servers.

If you make sure you use this selection, and then in options make sure indexes is selected, it should transfer all the data like you want it to.

if not, post a step through of exactly what you do in each step of DTS and i can check to see if there is something you are missing.

Matt.
0
 
LVL 1

Author Comment

by:loveneesh_bansal
Comment Utility
Thanks unclematt.



0
 
LVL 1

Author Comment

by:loveneesh_bansal
Comment Utility
Sorry Uncle matt

I am accepting your answer very late. Thanks for your kind support
0

Featured Post

Do You Know the 4 Main Threat Actor Types?

Do you know the main threat actor types? Most attackers fall into one of four categories, each with their own favored tactics, techniques, and procedures.

Join & Write a Comment

International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how the fundamental information of how to create a table.

744 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now