if(function(select count(*) from User where username= name and datetime = date())< 2) insert into User ....
乱写的是这个意思 [解决办法]
SQL code
create proc ProcNameas declare @count int select count(*) from TableName where username = '' and datediff(day,biday,getdate())=0 if(@count <= 2) begin insert into .....//插入语句 endgo [解决办法]
[解决办法] 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