dbTalk Databases Forums  

Need to create primary key, can I use the DTS wizard?

microsoft.public.sqlserver.dts microsoft.public.sqlserver.dts


Discuss Need to create primary key, can I use the DTS wizard? in the microsoft.public.sqlserver.dts forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
carroll
 
Posts: n/a

Default Need to create primary key, can I use the DTS wizard? - 02-23-2005 , 08:55 PM






I am just starting with DTS. I am trying to import a text file into a table.
In this text file the field that maps to the primary key in the SQL table has
non-unique data (every row has this value set to 0).

So far I have only been using the wizard to try to get this done, but I
can't see any means to have the tool just create unique values for me.

Any advice? Thanks.

Reply With Quote
  #2  
Old   
Allan Mitchell
 
Posts: n/a

Default Re: Need to create primary key, can I use the DTS wizard? - 02-24-2005 , 12:32 AM






You can use a Global Variable that gets incremented each time in the
pipeline for each row
You can, and this is the way I would go, load into a scratch table which
generated the unique values and then insert that into the real table

You will need to know the logic to create the key though. Is it an
incrementing integer?


Allan

"carroll" <carroll (AT) discussions (DOT) microsoft.com> wrote

Quote:
I am just starting with DTS. I am trying to import a text file into a
table.
In this text file the field that maps to the primary key in the SQL table
has
non-unique data (every row has this value set to 0).

So far I have only been using the wizard to try to get this done, but I
can't see any means to have the tool just create unique values for me.

Any advice? Thanks.


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.