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 - 2005-10-03 : 07:52:42
|
| kamalkishore writes "Hai gurusHow to generate the values automatically in a primary key column without using sequence or identity in sql server using triggers or procedures." |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2005-10-03 : 08:41:53
|
| Declare @i intSelect @i=Isnull(max(col),0)+1 from yourTableInsert into yourTable values(@i,.......)MadhivananFailing to plan is Planning to fail |
 |
|
|
ditch
Master Smack Fu Yak Hacker
1466 Posts |
Posted - 2005-10-03 : 08:42:49
|
Why do you want to do that?If the identity facility is there for you to use - rather use it.Duane. |
 |
|
|
Kristen
Test
22859 Posts |
Posted - 2005-10-03 : 13:08:17
|
| Plus its not quite atomic, is it?Kristen |
 |
|
|
X002548
Not Just a Number
15586 Posts |
|
|
jen
Master Smack Fu Yak Hacker
4110 Posts |
Posted - 2005-10-03 : 22:22:46
|
plus in between processing can really mess up the sequencing for parallel transactionsquote: Originally posted by Kristen Plus its not quite atomic, is it?Kristen
--------------------keeping it simple... |
 |
|
|
|
|
|