我有一个整数值id,它没关系,默认情况下它取值1,2,3 ......现在我想取这个值,如0001,0002,0003。怎么可能请帮助我。
USE [Companybook]
GO
/****** Object: Table [dbo].[Employees] Script Date: 12/05/2013 14:50:14 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Employees](
[EmployeeID] [int] IDENTITY(1,1) NOT NULL,
[LastName] [nchar](10) NULL,
[FirstName] [nchar](10) NULL,
[Country] [nchar](10) NULL,
CONSTRAINT [PK_Employees] PRIMARY KEY CLUSTERED
(
[EmployeeID] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
答案 0 :(得分:0)
嗨,你不能在Sql中使用0001作为身份,而不是你可以使用有效数字,如1001,2001,3001 ......
但你可以像你说的那样检索你的身份......