﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Discuss Content Posted by Alex Grinberg / Article Discussions / Article Discussions by Author  / Working With System Tables / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Wed, 19 Jun 2013 09:59:03 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Working With System Tables</title><link>http://www.sqlservercentral.com/Forums/Topic245397-229-1.aspx</link><description>Here's what I think is a little upgrade to #6. This sp reduces human interaction to 1 step, but completes the entire search before showing you the results... so pick your poisonALTER PROCEDURE [dbo].[sp_SearchTables] (	@TextPart varchar(1000))AS set nocount onDECLARE @data table (	ind int identity(1,1),	query varchar(1000))DECLARE @count intDECLARE @iRow intDECLARE @sql varchar(1000)CREATE table #output (	Context varchar(255) null,	ColumnName varchar(255) null,	TableName varchar(255) null)INSERT INTO @dataselect 'IF EXISTS(select [' + c.name + '] from [' + o.name         + '] where [' + c.name + '] like ''%' + @TextPart + '%'')' + CHAR(13) +		'insert into #output ' 		+' select ' + c.name +',''' + c.name + ''',''' + o.name +''' from ' + o.name + ' where '        + c.name + ' like ''%' + @TextPart + '%''' + CHAR(13) + CHAR(13)from syscolumns c   inner join systypes t on t.xtype=c.xtype  inner join sysobjects o on o.id = c.idwhere o.type = 'u' and c.id &gt; 500 and t.name in ('varchar', 'char')order by 1SET @count = @@ROWCOUNTSET @iRow = 1WHILE @iRow &lt;= @countBEGIN	select @sql = query from @data where ind = @iRow	exec(@sql)	SET @iRow = @iRow + 1ENDselect * from #outputdrop table #output</description><pubDate>Wed, 17 Jan 2007 13:51:00 GMT</pubDate><dc:creator>Jeff Scott-375773</dc:creator></item><item><title>RE: Working With System Tables</title><link>http://www.sqlservercentral.com/Forums/Topic245397-229-1.aspx</link><description>&lt;P&gt;Hi there,&lt;/P&gt;&lt;P&gt;After you run the sp_spaceused stored procedure, it will show the correct rowcount.&lt;/P&gt;</description><pubDate>Tue, 24 Jan 2006 01:57:00 GMT</pubDate><dc:creator>fai0626</dc:creator></item><item><title>RE: Working With System Tables</title><link>http://www.sqlservercentral.com/Forums/Topic245397-229-1.aspx</link><description>&lt;P&gt;I've been using "2. Get row count from all Tables" for some time now to monitor the size of tables and their changes over time.  Today, I noticed that some of the numbers on our system do not match up.&lt;/P&gt;&lt;P&gt;Using the "2. Get row count from all Tables" script I receive:&lt;/P&gt;&lt;P&gt;table name - 510312 records&lt;/P&gt;&lt;P&gt;When I run: "select count(*) from tablename" I receive&lt;/P&gt;&lt;P&gt;510542 records&lt;/P&gt;&lt;P&gt;This has me puzzled.  I thought the two outcomes should be the same.  Would anyone have a solution about this? Has anyone experienced anything similar?  Thanks.&lt;/P&gt;&lt;P&gt;Jan S.&lt;/P&gt;</description><pubDate>Thu, 19 Jan 2006 10:39:00 GMT</pubDate><dc:creator>SeaQL</dc:creator></item><item><title>RE: Working With System Tables</title><link>http://www.sqlservercentral.com/Forums/Topic245397-229-1.aspx</link><description>&lt;P&gt;If anybody hasn't seen the MS system table map before, you NEED to download it now.  Trust me, you will swap your Granny for it!!&lt;/P&gt;&lt;P&gt;&lt;A href="http://download.microsoft.com/download/SQLSVR2000/sysmap/2000/WIN98MeXP/EN-US/systbl.chm" target=_new&gt;http://download.microsoft.com/download/SQLSVR2000/sysmap/2000/WIN98MeXP/EN-US/systbl.chm&lt;/A&gt;&lt;/P&gt;</description><pubDate>Mon, 16 Jan 2006 12:53:00 GMT</pubDate><dc:creator>webtekkie</dc:creator></item><item><title>Working With System Tables</title><link>http://www.sqlservercentral.com/Forums/Topic245397-229-1.aspx</link><description>Comments posted to this topic are about the content posted at &lt;A HREF="http://www.sqlservercentral.com/columnists/aGrinberg/workingwithsystemtables.asp"&gt;http://www.sqlservercentral.com/columnists/aGrinberg/workingwithsystemtables.asp&lt;/A&gt;</description><pubDate>Mon, 19 Dec 2005 17:01:00 GMT</pubDate><dc:creator>Alex Grinberg-230981</dc:creator></item></channel></rss>