SQL

--插入语句 Sys_BusinessPermit表中有两个字段BusinessValue,PermitValue  Sys_Permit表中含有PermitValue字段   BusinessValue的值为'Sys_Manager'  把'Sys_Manager'作为BusinessValue的值,PermitValue的值为从表Sys_Permit中查询的符合条件的值
 INSERT INTO Sys_BusinessPermit SELECT 'Sys_Manager' as BusinessValue,PermitValue FROM Sys_Permit WHERE ModCode='01090207' 

--查询语句 查询所有表中含有列名(字段名)为'modvalue'的表

SELECT a.name FROM sysobjects a INNER JOIN syscolumns b on a.id=b.id and b.name='modvalue'
原文地址:https://www.cnblogs.com/yueyuepeng/p/4161022.html