if(function(select count(*) from User where username= name and datetime = date())< 2) insert into User ....
乱写的是这个意思
------解决方案--------------------
SQL code
create proc ProcName
as
declare @count int
select count(*) from TableName where username = '' and datediff(day,biday,getdate())=0
if(@count <= 2)
begin
insert into .....//插入语句
end
go
------解决方案--------------------
------解决方案-------------------- create proc ProcName @UserID varchar(20)='' as declare @count int select count(*) from TableName where username =@UserID and datediff(day,biday,getdate())=0
if(@count <= 2) begin insert into .....//插入语句 end go