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 |
|
baska123
Yak Posting Veteran
64 Posts |
Posted - 2007-11-19 : 15:26:10
|
| How do I generate next avaliable number in my sql statement. Here is my sqlInsert into [Schema].LOOKUP (ID,CODE,DESCRIPTION,LOOKUP_ID_PARENT) values (:Id, :Code, :Description, :LookupParentId)where ID is next avaliable number |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-11-19 : 15:31:31
|
| Use IDENTITY option for the ID column.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
baska123
Yak Posting Veteran
64 Posts |
Posted - 2007-11-19 : 15:36:26
|
| How do you do that? |
 |
|
|
evilDBA
Posting Yak Master
155 Posts |
Posted - 2007-11-19 : 15:38:14
|
| create table LOOKUP (ID int identity, CODE blah blah blah...) |
 |
|
|
baska123
Yak Posting Veteran
64 Posts |
Posted - 2007-11-19 : 15:49:42
|
| I already have a table and I have to work with it. It does not have an identity set up. any other alternatives? |
 |
|
|
tkizer
Almighty SQL Goddess
38200 Posts |
Posted - 2007-11-19 : 15:56:41
|
| Then modify your table so that it does.Tara KizerMicrosoft MVP for Windows Server System - SQL Serverhttp://weblogs.sqlteam.com/tarad/ |
 |
|
|
|
|
|