📜  如何在sql代码示例中生成id

📅  最后修改于: 2022-03-11 15:05:33.604000             🧑  作者: Mango

代码示例1
CREATE TABLE dbo.tblUsers
  (ID INT IDENTITY(1,1) NOT NULL PRIMARY KEY CLUSTERED,
   UserID AS 'UID' + RIGHT('00000000' + CAST(ID AS VARCHAR(8)), 8) PERSISTED,
   .... your other columns here....
  )