DECLARE @SearchText varchar(500), @SchemaName VARCHAR(500), @Table varchar(500), @ColumnName varchar(500), @String varchar(500); --modify the variable, specify the text to search for SET @SearchText = 'John'; SET @SearchText = 'adar' DECLARE CursorSearch CURSOR FOR SELECT TABLE_SCHEMA,TABLE_NAME,COLUMN_NAME FROM INFORMATION_SCHEMA.COLUMNS OPEN CursorSearch; FETCH NEXT FROM CursorSearch INTO @SchemaName,@Table,@ColumnName; WHILE @@FETCH_STATUS = 0 BEGIN PRINT 'SU ANDA ARAMA YAPTIGI TABLO: '+@Table+' KOLON ADI: '+@ColumnName SET @String = 'IF EXISTS (SELECT * FROM ' +@SchemaName+'.' + @Table + ' WITH(NOLOCK) WHERE ' + @ColumnName + ' LIKE ''%'+ @SearchText+ '%'') PRINT ''BULUNAN KAYIT:'+ @Table+ ', '+ @ColumnName+ ''''; EXECUTE (@String); FETCH NEXT FROM CursorSearch INTO @SchemaName,@Table,@ColumnName; END; CLOSE CursorSearch; DEALLOCATE CursorSearch;