日期:2014-05-18 浏览次数:20480 次
--表名不一样 SELECT TABLE_NAME FROM TEMP1.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE' AND TABLE_NAME NOT IN (SELECT TABLE_NAME FROM TEMP2.INFORMATION_SCHEMA.TABLES WHERE TABLE_TYPE = 'BASE TABLE') --表结构不一样 SELECT TEMP1.DBO.SYSOBJECTS.NAME AS TABLE_NAME, TEMP1.DBO.SYSCOLUMNS.NAME AS COLUMN_NAME FROM TEMP1.DBO.SYSCOLUMNS INNER JOIN TEMP1.DBO.SYSOBJECTS ON TEMP1.DBO.SYSCOLUMNS.ID = TEMP1.DBO.SYSOBJECTS.ID WHERE (TEMP1.DBO.SYSOBJECTS.XTYPE = 'u') AND (NOT (TEMP1.DBO.SYSOBJECTS.NAME LIKE 'dtproperties'))
------解决方案--------------------
右键数据库--任务--生成脚本