|
Home > Archive > MS SQL Server DTS > September 2005 > Adding Primary Key Field--Import/Export Wizard Issue
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Adding Primary Key Field--Import/Export Wizard Issue
|
|
| jacob 2005-09-23, 11:24 am |
| The original table has dublicate information because it was not properly
normalized. There can be several different primary key values for the same
item. For example:
1 GoodBookTitle
2 GoodBookTitle
3 PracticalBookTitle
4 GoodBookTitle
5 PracticalBookTitle
6 OkBookTitle
I leave the primary key out of the query and use the group by statement to
eliminate the duplicates. The Import/Export Wizard is able to save the
information to the destination table however, it doesn't add a unique primary
key field. If i check the box "Enable identity insert" it does not add a
primary key field. If i remove the check it still does not. If i create the
table in advance with a primary key field it gives me an error saying it
cannot insert data with a null primary key value.
So, i can get the results into the table but i can't add a primary key to
the table either while i copy the info into the destination table or
afterwards.
Can anyone help me?
| |
| Allan Mitchell 2005-09-24, 7:23 am |
| Enabling Identity Insert does not mean that an Identity column will be
created for you rather it is a method to allow you to insert into one.
Create a numeric attribute with an Identity property and look through
this article it may help.
Problems With IDENTITY() and the DataPump task.
(http://www.sqldts.com/default.aspx?293)
Allan
"jacob" <jacob@discussions.microsoft.com> wrote in message
news:63599C50-611C-4BCF-A4D9- BB228E71FCAB@microso
ft.com:
> The original table has dublicate information because it was not properly
> normalized. There can be several different primary key values for the
> same
> item. For example:
>
> 1 GoodBookTitle
>
> 2 GoodBookTitle
>
> 3 PracticalBookTitle
>
> 4 GoodBookTitle
>
> 5 PracticalBookTitle
>
> 6 OkBookTitle
>
> I leave the primary key out of the query and use the group by statement
> to
> eliminate the duplicates. The Import/Export Wizard is able to save the
> information to the destination table however, it doesn't add a unique
> primary
> key field. If i check the box "Enable identity insert" it does not add
> a
> primary key field. If i remove the check it still does not. If i create
> the
> table in advance with a primary key field it gives me an error saying it
> cannot insert data with a null primary key value.
>
> So, i can get the results into the table but i can't add a primary key
> to
> the table either while i copy the info into the destination table or
> afterwards.
>
> Can anyone help me?
|
|
|
|
|