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.

Eg.
PT001
PT002
PT003

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.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.