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.
| Author |
Topic |
|
AskSQLTeam
Ask SQLTeam Question
0 Posts |
Posted - 2006-02-09 : 09:41:45
|
| Sarah writes "Hi All,I would like to know how can I (identity column on SQL server)auto Sequencing & insert a Record in identity field from ASP?I'd be thankfull if you explain the answer in step and showing some Examples.My Emial ID is there.. Awaithing for your response soon.Thanks in advanced,sara" |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-02-09 : 09:44:17
|
| If you use Identity column, exclude that in your insert statement so that it will be incremented automatically whenever new row is inserted to the tableMadhivananFailing to plan is Planning to fail |
 |
|
|
mallier
Starting Member
24 Posts |
Posted - 2006-02-09 : 09:55:50
|
| --or u can set identity insert on--SET IDENTITY_INSERT tablename ON-- then ur insert statmentcheers,http://mallier.blogspot.com |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-02-09 : 10:00:11
|
| And dont forget to set it off at the endSET IDENTITY_INSERT tablename ON-- then ur insert statmentSET IDENTITY_INSERT tablename OFFMadhivananFailing to plan is Planning to fail |
 |
|
|
afrika
Master Smack Fu Yak Hacker
2706 Posts |
Posted - 2006-02-09 : 10:56:01
|
auto increment ?the table below has an auto increment value on the MyID column, which starts at 1 and increments with 1.CREATE TABLE [dbo].[myexample] ( [MyID] [int] IDENTITY (1, 1) NOT NULL , [other_columns1] [varchar] (50) COLLATE SQL_Latin1_General_CP1_CI_AS NULL )GO NOTE: You cant insert an indentity column, unless you set the identity_insert value off as above |
 |
|
|
|
|
|