sp_helptext proc_SetJurisdictiongoCREATE proc proc_SetJurisdiction(@p_id varchar(40),@staffs varchar(300),@groups varchar(300))asbeginbegin tranbegin tryif exists(select * from Project_Jurisdiction where p_id = @p_id)begindelete from Project_Jurisdiction where p_id =@p_idendif(@staffs<>'')begininsert into Project_Jurisdiction(p_id,j_id,j_type)select @p_id p_id,id j_id,0 j_type from F_Char_s(@staffs)endif(@groups<>'')begininsert into Project_Jurisdiction(p_id,j_id,j_type)select @p_id p_id,id j_id,1 j_type from F_Char_s(@groups)endcommit transelect '1'end trybegin catchrollback transelect '0'end catchend