日期:2014-05-16 浏览次数:20655 次
alter table [dbo].[Cons_RecordCheckIn]
drop constraint[PK_Cons_RecordCheckIn]
go
--假设ntime是datetime类型
alter table [dbo].[Cons_RecordCheckIn]
add ntime_10 as convert(varchar(10),ntime,120) --如果是varchar的话:left(ntime,10)
go
ALTER TABLE [dbo].[Cons_RecordCheckIn]
ADD CONSTRAINT [PK_Cons_RecordCheckIn] PRIMARY KEY CLUSTERED
(
[ntime_10] ASC,
[UCardNo] ASC
)WITH (PAD_INDEX = OFF, STATISTICS_NORECOMPUTE = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO