Computing.Net > Forums > Database > Inserting value in an identity column

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

Inserting value in an identity column

Reply to Message Icon

Name: Daisy B.
Date: June 6, 2009 at 07:11:19 Pacific
OS: Win XP
CPU/Ram: Dual core/ 2GB
Subcategory: MS SQL Server
Comment:

Hi,
Here's a short program of a table in SQL.

create table students
(
rollno int identity,
name char(20)
)

In order to insert explicit value in the identity column (i.e. rollno), I need to specify that the identity_insert is on. After having this mode on, if I insert the value (0008) in the identity column then after the execution of the query, the value is displayed as (8), whereas I want it to be (0008). Please help me to do so.



Sponsored Link
Ads by Google
Reply to Message Icon

Related Posts

See More






Use following form to reply to current message:

Login or Register to Reply
LoginRegister


Sponsored links

Ads by Google


Results for: Inserting value in an identity column

Problem in inserting values to a table in SQL www.computing.net/answers/dbase/problem-in-inserting-values-to-a-table-in-sql/710.html

selecting few values in oracle www.computing.net/answers/dbase/selecting-few-values-in-oracle-/93.html

SQL Server 7.0 www.computing.net/answers/dbase/sql-server-70/618.html