I want to create a primary key(auto-increment) which is start with A001000001.
Here A001 would be constant and 000001 would be iterate.
I want rows like this:

How can I do it using SQL query?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
For SQL Server (you didn’t clearly specify which RDBMS you’re using), my suggestion would be:
INT IDENTITYcolumn to your table – and quite frankly, I would make that column the primary keySomething like:
That way, if you insert a row, the
IDgets set automatically, and theEmpIDwill also be set automatically to values likeA0010000001,A0010000002, …. and so forth.If you want to put the primary key on the
EmpIDcolumn, then you need to make sure to include theNOT NULLspecification when creating it:and then you can put the primary key constraint on that column: