Hi all,

I am creating a windows application. I have a column in the backend - MS sql server 2005 as ID which stores Patient Id.

The values for this column should start with
PT and contain the serial numbers in ascending order.


I want to generate this automatically however identity does not allow this type of values.

Then how can I do this?

Is there any way I could do this automatically?

Please help me out!
Thanks in advance!!

Use substring to seperate alphabets and digits and convert digits into to numeric for increments, append zeors and concat them.