Monday 16th of September 2019 10:22:43 PM
Our Services
Select Theme
Back
CREATE Proc [dbo].[FindTable]
@TableName nVarchar(50)
As

Create Table #temp (DatabaseName varchar(50),SchemaName
varchar(50),TableName varchar(50))

Declare @SQL Varchar(500)
Set @SQL='Use [?] ;
if exists(Select name from sys.tables where name like '''+@TableName+''')
insert into #temp
Select ''?'' AS DatabaseName ,SS.Name AS SchemaName ,ST.Name AS
TableName from sys.tables as ST , sys.schemas SS
where ST.Schema_ID=SS.Schema_ID and ST.name like '''+@TableName+''''

EXEC sp_msforeachdb @SQL

Select * from #temp

Drop table #temp
 
     
     
Home | About Us | Products | Services |  Templates | Demo | Contact Us | Careers | Feedback | SiteMap
2005-2014 Logical Technologies. All Rights Reserved.