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 2005 Forums
 SSIS and Import/Export (2005)
 Import and Increment

Author  Topic 

kingmullet
Starting Member

1 Post

Posted - 2012-07-24 : 13:51:23
I have a table that I have imported from excel
Firstname, Lastname, LoginID. THis table contains over 900 users. We have a table that is the master table and for every user ther is a unique instance id. How can I import the new users into the master table and have the instance id auto increment for each new record?

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2012-07-24 : 14:07:14
Is the unique instance id an identity column? If it is, it'll auto-increment on its own just by not including the column name in the insert/select query.

If it's not an identity column, you can use ROW_NUMBER() function to get number them.

Tara Kizer
Microsoft MVP for Windows Server System - SQL Server
http://weblogs.sqlteam.com/tarad/

Subscribe to my blog
Go to Top of Page
   

- Advertisement -