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 |
|
Rawler
Starting Member
9 Posts |
Posted - 2011-01-28 : 16:34:49
|
| Hi all!I got a [city] table with these columns [idDepartment] [idCity] [nCity]; is there a way to set [idCity] an identity column, depending on which [idDepartment] was the insert?ie: [idDepartment] [idCity] [nCity] (before insert)1, 1, 'myCity'1, 2, 'aCity'2, 1, 'myCity2'and if I insert [idDepartment]=1, [nCity]='anotherCity', the result be:[idDepartment] [idCity] [nCity] (result)1, 1, 'myCity'1, 2, 'aCity'1, 3, 'anotherCity'2, 1, 'myCity2' |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
|
|
|
|
|
|
|