create table #t (
DBName sysname not null
)
go
exec sp_msforeachdb 'use [?]; if OBJECT_ID(''schema name.table name/stored procedure name'') is not null insert into #t (DBName) select ''?'''
go
select * from #t
go
drop table #t
DBName sysname not null
)
go
exec sp_msforeachdb 'use [?]; if OBJECT_ID(''schema name.table name/stored procedure name'') is not null insert into #t (DBName) select ''?'''
go
select * from #t
go
drop table #t
No comments:
Post a Comment