Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 txt file import with autoincrement

Author  Topic 

olebomail
Starting Member

2 Posts

Posted - 2005-12-07 : 05:47:25
Oups,

I would like to make an import of a text file into an SQL table with an autoincrement of the key field.

ex:
Table1:
Field1: ID bigint 8 (Key)
Field2: Name varchar 60
Field": Adress varchar 80

ex
txt file: "name1","adress1" <SEPARATOR> "name2","adress2"<SEPARATOR>.....
How do I make the key field autoincremented with every new record imported?
Thank you

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2005-12-07 : 09:14:37
Create the table as
create table Table1
(
ID bigint identity (1,1),
Name varchar(60),
Adress varchar(80)
)


-----------------
[KH]
Go to Top of Page

olebomail
Starting Member

2 Posts

Posted - 2005-12-07 : 10:18:10
ok,
identity seed and increment are set to 1.
Go to Top of Page
   

- Advertisement -