SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2005 Forums
 SSIS and Import/Export (2005)
 Import and Increment
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

kingmullet
Starting Member

1 Posts

Posted - 07/24/2012 :  13:51:23  Show Profile  Reply with Quote
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

USA
36661 Posts

Posted - 07/24/2012 :  14:07:14  Show Profile  Visit tkizer's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.06 seconds. Powered By: Snitz Forums 2000