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
 Site Related Forums
 Article Discussion
 Inserting values in auto-identity column
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

bharatg
Starting Member

6 Posts

Posted - 04/04/2005 :  10:49:56  Show Profile  Reply with Quote
I'm a bit new to SQL Server, but here is the problem I am trying to get around:

1. I have lets say an Employee table where the emp_id is an identity column that is auto assigned by the db.
2. I wish to insert values into the tables, but sometimes I may wish to use the value of the emp_id that i supply while inserting (and sometimes not).

Is there any way in MS SQL to do this? For e.g. is it setup like a constraint that I can temporarily drop. I do not want to alter the table, so that option is ruled out.

Any other ways to do this (I know bcp is one of them that allows me to do this, but looking for ways in the db itself using SQL if possible)

Thanks,
Bharat

AndrewMurphy
Flowing Fount of Yak Knowledge

Ireland
2916 Posts

Posted - 04/04/2005 :  11:18:05  Show Profile  Reply with Quote
duplicate.

http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=47936
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.04 seconds. Powered By: Snitz Forums 2000