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 |
|
cronincoder
Yak Posting Veteran
56 Posts |
Posted - 2007-01-29 : 15:20:35
|
| I've added a id_col column to a table so that I can add sequential unique numbersalter table mytableadd id_col varchar2(20) NOT NULL;I now want to populate this table with unique numbers starting at:12345.....but I'm sure of the update query for this..any ideas? |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-29 : 15:24:19
|
| VARCHAR2 is not a valid SQL Server data type.Which are the other columns in the table?Peter LarssonHelsingborg, Sweden |
 |
|
|
cronincoder
Yak Posting Veteran
56 Posts |
Posted - 2007-01-29 : 15:28:17
|
| sorry, just varchar |
 |
|
|
cronincoder
Yak Posting Veteran
56 Posts |
Posted - 2007-01-29 : 15:29:59
|
| other columns are:account_numbername |
 |
|
|
SwePeso
Patron Saint of Lost Yaks
30421 Posts |
Posted - 2007-01-29 : 15:36:11
|
| update t1set t1.id_col = (select cast(count(*) as varchar) from table1 as t2 on t2.account_number <= t1.account_number)from table1 as t1Peter LarssonHelsingborg, Sweden |
 |
|
|
|
|
|