[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 479
  • Last Modified:

Prepend and Auto Increment Primary key?

How do you prepend and auto increment primary key? I would like to prepend it with a letter. What would I change the data type to?
0
comtekso
Asked:
comtekso
  • 6
  • 2
1 Solution
 
ellandrdCommented:
>>What would I change the data type to?

CREATE TABLE tblInfo (
      ID INT NOT NULL AUTO_INCREMENT,
      title VARCHAR(150),
      category VARCHAR(150),
      PRIMARY KEY(ID)
)
0
 
ellandrdCommented:
you would then attach the value to your letter header or title
0
 
comteksoAuthor Commented:
I'm not sure I understand. Would that allow me to have the ID be something like a1, a2, a3 etc...?
0
Free Backup Tool for VMware and Hyper-V

Restore full virtual machine or individual guest files from 19 common file systems directly from the backup file. Schedule VM backups with PowerShell scripts. Set desired time, lean back and let the script to notify you via email upon completion.  

 
ellandrdCommented:
no auto increment only allows single integers like, 1,2,3,4,...
0
 
comteksoAuthor Commented:
OK thanks.
0
 
ellandrdCommented:
did you find your answer?
0
 
ellandrdCommented:
thank you for grade!!!

;-)
0

Featured Post

 [eBook] Windows Nano Server

Download this FREE eBook and learn all you need to get started with Windows Nano Server, including deployment options, remote management
and troubleshooting tips and tricks

  • 6
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now