SQL 自行构造数据源
INSERT INTO dbo.MenuPermissions
( intFunPageCode ,
intFatherCode ,
nvcName,
StationID ,
BelongedTo
)
SELECT intFunPageCode,intFatherCode,nvcName,StationID,BelongedTo FROM dbo.MenuConfiguration AS mc
LEFT JOIN (
SELECT StationID ,ImaTypeName
FROM ( SELECT '岗位' 监督岗 ,
'岗位' 领导岗 ,
'岗位' 资料岗 ,
'岗位' 信息岗
) tb UNPIVOT ( ImaTypeName FOR StationID IN ( 监督岗, 领导岗, 资料岗,信息岗 ) ) t ) im ON im.ImaTypeName='岗位'
WHERE mc.MenuType='0'
AND mc.BelongedTo='AJ320000-1'