YESWEB数据库更改APPID脚本


YESWEB开发数据库中更改APPID脚本

declare @oldAPPID varchar(50)
declare @newAPPID varchar(50)

set @oldAPPID='APP0004'
set @newAPPID='APP_PCWEB_005'

/*
select * from sys_microApps
select * from sys_microApps_Routers order by RouteID
select * from sys_microApps_Routers_Authorize
select * from sys_microApps_Routers_Authorize_URLs
select * from sys_menu
select * from base_Authorize
select * from base_DataSNDetail
*/
/*
select  _appid=@newAPPID,* from sys_microApps where appid=@oldAPPID
select _appid=@newAPPID,_RouteID=@newAPPID+substring(RouteID,len(@oldAPPID)+1,len(RouteID)),* from sys_microApps_Routers where appid=@oldAPPID
select _appid=@newAPPID,_RouteID=@newAPPID+substring(RouteID,len(@oldAPPID)+1,len(RouteID)),_AuthorizeID=@newAPPID+substring(AuthorizeID,len(@oldAPPID)+1,len(AuthorizeID)),* from sys_microApps_Routers_Authorize where appid=@oldAPPID
select _appid=@newAPPID,_RouteID=@newAPPID+substring(RouteID,len(@oldAPPID)+1,len(RouteID)),AuthorizeID=@newAPPID+substring(AuthorizeID,len(@oldAPPID)+1,len(AuthorizeID)),* from sys_microApps_Routers_Authorize_URLs where appid=@oldAPPID
select _RouteID =@newAPPID+substring(RouteID,len(@oldAPPID)+1,len(RouteID)),* from sys_menu where RouteID like @oldAPPID+'%'
select _ItemID =@newAPPID+substring(ItemID,len(@oldAPPID)+1,len(ItemID)),* from base_Authorize where ItemID like @oldAPPID+'%'

*/


update sys_microApps set appid=@newAPPID where appid=@oldAPPID
update sys_microApps_Routers set appid=@newAPPID,RouteID=@newAPPID+substring(RouteID,len(@oldAPPID)+1,len(RouteID)) where appid=@oldAPPID
update sys_microApps_Routers_Authorize set appid=@newAPPID,RouteID=@newAPPID+substring(RouteID,len(@oldAPPID)+1,len(RouteID)),AuthorizeID=@newAPPID+substring(AuthorizeID,len(@oldAPPID)+1,len(AuthorizeID)) where appid=@oldAPPID
update sys_microApps_Routers_Authorize_URLs set appid=@newAPPID,RouteID=@newAPPID+substring(RouteID,len(@oldAPPID)+1,len(RouteID)),AuthorizeID=@newAPPID+substring(AuthorizeID,len(@oldAPPID)+1,len(AuthorizeID)) where appid=@oldAPPID
update sys_menu set RouteID =@newAPPID+substring(RouteID,len(@oldAPPID)+1,len(RouteID)) where RouteID like @oldAPPID+'%'
update base_Authorize set ItemID =@newAPPID+substring(ItemID,len(@oldAPPID)+1,len(ItemID)) where ItemID like @oldAPPID+'%'
update base_DataSNDetail set Seed =@newAPPID+substring(Seed,len(@oldAPPID)+1,len(Seed)) where Seed like @oldAPPID+'%'
GarsonZhang www.yesdotnet.com

 

版权声明:本文为YES开发框架网发布内容,转载请附上原文出处连接
YES开发框架
评论列表

发表评论

评论内容
昵称:
关联文章