关联表更新字段 UPDATE tmp369faa3f7d224b0595670425008 as t1 SET FStatus=-1 where exists(select 1 from t_BD_Supplier where FUseOrgId = t1.FDestOrgID and FMasterId = t1.FMasterId) UPDATE 后面使用别名必须加AS: 另一种写法: update t_pm_otherowner set fcontrolunitid=(select fco…
----查询所有的表 SELECT * FROM SYSOBJECTS WHERE TYPE='U' ----根据表名查询所有的字段名及其注释 SELECT A.NAME,B.VALUE FROM SYSCOLUMNS A LEFT JOIN SYS.EXTENDED_PROPERTIES B ON A.ID=B.MAJOR_ID AND A.COLID=B.MINOR_ID INNER JOIN SYSOBJECTS C ON A.ID=C.ID AND UPPER(C.NAME)='tb_n…