34,838
社区成员




2表chitty(单据表)
chitty_id chitty_ok(是否审核)
1 1
2 0
3 1
...
CREATE proc sp_Delchitty
@selecteds varchar(300)
AS
if exists(select 1 from chitty where chitty_id=@selecteds and chitty_oK)
begin
return -1
end
CREATE proc sp_Delfolk
@selecteds varchar(300),
@use int output
AS
IF (Select count(1) from hr_staff where charindex(','+ staff_folk+',',','+@selecteds+',')>0)>0
set @use=-1
else
set @use=0
IF EXISTS(Select * from hr_staff where charindex(','+staff_folk+',',','+@selecteds+',')>0)
declare @selecteds varchar(300)
set @selecteds = '''A'',''B'',''C'''
select @selecteds as '@selecteds'
/*
@selecteds
------------
'A','B','C'
(1 行受影响)
*/