I wish to create a unique column in a sybase table that currently contains 7 million rows. I also want future row inserts to have similar uniqueness when inserted using a cursor in a stored proc. The table will need to have a column added to it.
It was suggested that the problem could be resolved by creating a unique column with a (datetime + random number) value. This should create a unique value for each record as the cursor inserts it. This presents a two fold problem. I don't seem able to add a random number to a datetime and converting the datetime to an integer does not appear to be permitted. Additionally, this method will not resolve how to create unique numbers for the 7 million records already in the table.
I could try the 'identity_column' but that can often lead to some really strange values.
Any ideas?
It was suggested that the problem could be resolved by creating a unique column with a (datetime + random number) value. This should create a unique value for each record as the cursor inserts it. This presents a two fold problem. I don't seem able to add a random number to a datetime and converting the datetime to an integer does not appear to be permitted. Additionally, this method will not resolve how to create unique numbers for the 7 million records already in the table.
I could try the 'identity_column' but that can often lead to some really strange values.
Any ideas?