|
|
发表于 2012/6/11 11:34:51
|
显示全部楼层
declare @FObjectType int
declare @FObjectID int
declare @FIndex smallint
declare @FIndex1 smallint
declare @FAccessMask int
declare @FAccessUse int
declare @FName nvarchar(255)
declare @FDescription nvarchar(255)
declare @FName_cht nvarchar(255)
declare @FName_en nvarchar(255)
declare @FDescription_cht nvarchar(255)
declare @FDescription_en nvarchar(255)
declare mycursor cursor for
select FObjectType,FObjectID,FIndex,FAccessMask,FAccessUse,FName,FDescription,FName_cht,FName_en,FDescription_cht,FDescription_en --into #temp
from(
select t1.*,t2.fobjecttype fobjecttype1,t2.fobjectid fobjectid1,t2.fname fname1 from Biaozhun..t_objectaccesstype t1 left join t_objectaccesstype t2 on t1.fobjecttype=t2.fobjecttype and t1.fobjectid=t2.fobjectid and t1.fname=t2.fname
)x where fobjectid1 is null
open mycursor
fetch mycursor into @FObjectType,@FObjectID,@FIndex,@FAccessMask,@FAccessUse,@FName,@FDescription,@FName_cht,@FName_en,@FDescription_cht,@FDescription_en
While(@@fetch_status = 0)
Begin
select @FIndex1=max(findex) from t_objectaccesstype where fobjecttype=@FObjectType and fobjectid=@FObjectID
select @FIndex1=@FIndex1+1
insert into t_objectaccesstype(FObjectType,FObjectID,FIndex,FAccessMask,FAccessUse,FName,FDescription,FName_cht,FName_en,FDescription_cht,FDescription_en)
values(@FObjectType,@FObjectID,@FIndex1,@FAccessMask,@FAccessUse,@FName,@FDescription,@FName_cht,@FName_en,@FDescription_cht,@FDescription_en)
fetch mycursor into @FObjectType,@FObjectID,@FIndex,@FAccessMask,@FAccessUse,@FName,@FDescription,@FName_cht,@FName_en,@FDescription_cht,@FDescription_en
end
close mycursor
Deallocate mycursor
go
----自己看一下,好久以前写的,biaozhun 是你新建的一个没有动过的账套,把丢了得权限条目加上 |
|