SQLSERVER多表關聯刪除:object
DELETE TABLE_A
FROM TABLE_A DD INNER JOIN TABLE_B D ON DD.DIFFER_LOG_ID = D.LOG_ID
WHERE D.UP_DATE = 20170915;select
SQLSERVER多表關聯修改:查詢
UPDATE TABLE_A SET COLUMN = 'X'
FROM TABLE_A A INNER JOIN TABLE_B B ON A.COLUMN_1 = B.COLUMN_1
WHERE A.COLUMN_2 = 'Y';co
SQLSERVER查詢表的字段類型:
select a.name 表名,b.name 字段名,c.name 字段類型,c.length 字段長度 from sysobjects a,syscolumns b,systypes c where a.id=b.idand a.name='TABLE_NAME' and a.xtype='U'and b.xtype=c.xtype