Auto increment avarchar

greenspun.com : LUSENET : SQL Server Database Administration : One Thread

Hi

Need some help from you. How does one write a script that will auto increment a varchar field. Assuming that it is defined as the primary key of a table.

Thanks

-- Anonymous, August 15, 2001

Answers

Justin,

A varchar is character data. What do you mean when you ask about incrementing such a field?

Eric

-- Anonymous, August 21, 2001


I needed to use a varchar field as the primary key of a table but want a script that can generate the needed value on each insert.

Thanks

-- Anonymous, August 22, 2001


Justin,

I suggest a that you use an insert trigger that will do the incrementing.

Hope this helps,

Eric

-- Anonymous, August 23, 2001


Moderation questions? read the FAQ