declare @Platform nvarchar(100) = '库名'
declare @Platform_BusinessData nvarchar(100) = '库名' declare @LastModifyDate nvarchar(100) = '2017-02-16 00:00:00' --修改时间declare @sql nvarchar(max) = 'if OBJECT_ID(''tempdb..#t'') is not null drop table #tselect * into #t from ( select ''' + @Platform + '..'' + o.name + isnull(''.'' + tb.name, '''') name, o.create_date, o.modify_date,o.type_desc FROM ' + @Platform + '.sys.all_objects o left join ' + @Platform + '.sys.triggers t on t.object_id = o.object_id left join ' + @Platform + '.sys.tables tb on tb.object_id = t.parent_id union all select ''' + @Platform_BusinessData + '..'' + o.name + isnull(''.'' + tb.name, ''''), o.create_date, o.modify_date,o.type_desc FROM ' + @Platform_BusinessData + '.sys.all_objects o left join ' + @Platform_BusinessData + '.sys.triggers t on t.object_id = o.object_id left join ' + @Platform_BusinessData + '.sys.tables tb on tb.object_id = t.parent_id ) t where modify_date >=''' + @LastModifyDate + '''--select distinct type_desc from #tselect * from #t where type_desc = ''USER_TABLE'' select * from #t where type_desc = ''SQL_STORED_PROCEDURE'' select * from #t where type_desc = ''SQL_SCALAR_FUNCTION'' or type_desc = ''SQL_TABLE_VALUED_FUNCTION'' select * from #t where type_desc = ''VIEW'' select * from #t where type_desc = ''SQL_TRIGGER''' print @Sqlexec sp_executesql @sql-- select * from UBIPlatform..HY_SOLUTION where SolutionName like 'Case%' or SolutionName like '%Review'