在线等 联合主键问题
alter table NB_Consumer_2 add constraint UK_UserNameCrDate unique(UserID,CONVERT(varchar(10),CreDate,112))
use tempdbgoCreate table Test(ID int not null,ID2 int not null--非null)goalter table Test add constraint PK_Test primary key (ID,ID2)
[解决办法]
你需要存时分秒吗? date类型如何?
要不就再加一个字段吧。