<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: SQL SERVER &#8211; 2005 List All Tables of Database</title>
	<atom:link href="http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/</link>
	<description>Notes of a SQL Server MVP and Database Administrator</description>
	<lastBuildDate>Sat, 21 Nov 2009 05:54:09 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: dharma</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57729</link>
		<dc:creator>dharma</dc:creator>
		<pubDate>Thu, 19 Nov 2009 07:59:26 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57729</guid>
		<description>how can i display  the no of tables present in the  database and also displays the table name present in the database</description>
		<content:encoded><![CDATA[<p>how can i display  the no of tables present in the  database and also displays the table name present in the database</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: arul</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57695</link>
		<dc:creator>arul</dc:creator>
		<pubDate>Wed, 18 Nov 2009 10:56:02 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57695</guid>
		<description>reply by example</description>
		<content:encoded><![CDATA[<p>reply by example</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: praveen</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57422</link>
		<dc:creator>praveen</dc:creator>
		<pubDate>Sun, 08 Nov 2009 02:45:50 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57422</guid>
		<description>what is Invalid object name &#039;sys.tables&#039;.  in sql server 2000???


can u plss help me!!!!!!!!!</description>
		<content:encoded><![CDATA[<p>what is Invalid object name &#8217;sys.tables&#8217;.  in sql server 2000???</p>
<p>can u plss help me!!!!!!!!!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sourabh Sachdeva</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57377</link>
		<dc:creator>Sourabh Sachdeva</dc:creator>
		<pubDate>Fri, 06 Nov 2009 07:26:52 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57377</guid>
		<description>Hi Vidhyasri,

you can use:

sp_tables

OR

you can use:

select * from information_schema.tables

OR
 

You can use:

select * from sys.tables

OR

you can use:

select * from sys.objects where type=&#039;U&#039;

Note: type=&#039;U&#039; not use xtype


So all these are different way of getting all tables from sql server.</description>
		<content:encoded><![CDATA[<p>Hi Vidhyasri,</p>
<p>you can use:</p>
<p>sp_tables</p>
<p>OR</p>
<p>you can use:</p>
<p>select * from information_schema.tables</p>
<p>OR</p>
<p>You can use:</p>
<p>select * from sys.tables</p>
<p>OR</p>
<p>you can use:</p>
<p>select * from sys.objects where type=&#8217;U&#8217;</p>
<p>Note: type=&#8217;U&#8217; not use xtype</p>
<p>So all these are different way of getting all tables from sql server.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ambanna</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57354</link>
		<dc:creator>Ambanna</dc:creator>
		<pubDate>Thu, 05 Nov 2009 12:25:40 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57354</guid>
		<description>Hi Vidhyasri,

you can use any of this query to get all the tables from a particular database

select * from INFORMATION_SCHEMA.TABLES
or
select * from sysobjects where xtype=&#039;U&#039;
or
select * from sys.tables


Regards,
Ambanna Yatnal</description>
		<content:encoded><![CDATA[<p>Hi Vidhyasri,</p>
<p>you can use any of this query to get all the tables from a particular database</p>
<p>select * from INFORMATION_SCHEMA.TABLES<br />
or<br />
select * from sysobjects where xtype=&#8217;U&#8217;<br />
or<br />
select * from sys.tables</p>
<p>Regards,<br />
Ambanna Yatnal</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vidhyasri</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57340</link>
		<dc:creator>vidhyasri</dc:creator>
		<pubDate>Thu, 05 Nov 2009 04:19:54 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57340</guid>
		<description>Hi 

I am new to this SQL.. I want to know how can get the tables from data base..

Can you tell me in a easy way please... I need it as soon as possible to resolve an issue :( 

Thanks
Vidhyasri M</description>
		<content:encoded><![CDATA[<p>Hi </p>
<p>I am new to this SQL.. I want to know how can get the tables from data base..</p>
<p>Can you tell me in a easy way please&#8230; I need it as soon as possible to resolve an issue :( </p>
<p>Thanks<br />
Vidhyasri M</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ambanna</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57326</link>
		<dc:creator>Ambanna</dc:creator>
		<pubDate>Wed, 04 Nov 2009 12:29:43 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57326</guid>
		<description>Hi Chaya,

you can use the following query.

select *from information_schema.columns where table_name=&#039;ITEM&#039; order by column_name</description>
		<content:encoded><![CDATA[<p>Hi Chaya,</p>
<p>you can use the following query.</p>
<p>select *from information_schema.columns where table_name=&#8217;ITEM&#8217; order by column_name</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Chaya</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57306</link>
		<dc:creator>Chaya</dc:creator>
		<pubDate>Tue, 03 Nov 2009 20:27:28 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57306</guid>
		<description>Hello, 

I tried to run the following query for display columnames in Ascending order from table Item:-

exec sp_columns Item order by Column_name Asc

I get the following error:-
Msg 156, Level 15, State 1, Line 1
Incorrect syntax near the keyword &#039;order&#039;.

How shhould I construct the query in order to get the desired results?</description>
		<content:encoded><![CDATA[<p>Hello, </p>
<p>I tried to run the following query for display columnames in Ascending order from table Item:-</p>
<p>exec sp_columns Item order by Column_name Asc</p>
<p>I get the following error:-<br />
Msg 156, Level 15, State 1, Line 1<br />
Incorrect syntax near the keyword &#8216;order&#8217;.</p>
<p>How shhould I construct the query in order to get the desired results?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sourabh Sachdeva</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57206</link>
		<dc:creator>Sourabh Sachdeva</dc:creator>
		<pubDate>Sat, 31 Oct 2009 13:09:11 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57206</guid>
		<description>Hi Lakshmi,


I think there is no any build in table or any built in function in sql server through you can count number of records in all the tables.

But i have created a logic through you can get number of records from all tables....

You can use this:

declare @dynamicqry as varchar(1000)
create table temp(tid int)
declare @startvalue as int
declare @endvalue as int
set @startvalue=1
select @endvalue=count(*) from INFORMATION_SCHEMA.TABLES
while @startvalue&lt;@endvalue
begin
declare @tablename as varchar(100)
select @tablename=Table_name from (select Table_name,ROW_NUMBER() over(order by table_name asc) &#039;RowNum&#039; from information_schema.tables) tt where RowNum=@startvalue
set @dynamicqry=&#039;insert temp select count(*) from &#039;+@tablename
print @dynamicqry
exec(@dynamicqry)
set @startvalue+=1
end
select SUM(tid) from temp</description>
		<content:encoded><![CDATA[<p>Hi Lakshmi,</p>
<p>I think there is no any build in table or any built in function in sql server through you can count number of records in all the tables.</p>
<p>But i have created a logic through you can get number of records from all tables&#8230;.</p>
<p>You can use this:</p>
<p>declare @dynamicqry as varchar(1000)<br />
create table temp(tid int)<br />
declare @startvalue as int<br />
declare @endvalue as int<br />
set @startvalue=1<br />
select @endvalue=count(*) from INFORMATION_SCHEMA.TABLES<br />
while @startvalue&lt;@endvalue<br />
begin<br />
declare @tablename as varchar(100)<br />
select @tablename=Table_name from (select Table_name,ROW_NUMBER() over(order by table_name asc) &#039;RowNum&#039; from information_schema.tables) tt where RowNum=@startvalue<br />
set @dynamicqry=&#039;insert temp select count(*) from &#039;+@tablename<br />
print @dynamicqry<br />
exec(@dynamicqry)<br />
set @startvalue+=1<br />
end<br />
select SUM(tid) from temp</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Lakshmi</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57168</link>
		<dc:creator>Lakshmi</dc:creator>
		<pubDate>Fri, 30 Oct 2009 04:48:22 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-57168</guid>
		<description>How to find the number of records from all the tables in sql 2005?</description>
		<content:encoded><![CDATA[<p>How to find the number of records from all the tables in sql 2005?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: kapil dhariwal</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56559</link>
		<dc:creator>kapil dhariwal</dc:creator>
		<pubDate>Fri, 09 Oct 2009 13:16:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56559</guid>
		<description>select * from sysobjects where xtype=&#039;U&#039;</description>
		<content:encoded><![CDATA[<p>select * from sysobjects where xtype=&#8217;U&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: mohanty</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56402</link>
		<dc:creator>mohanty</dc:creator>
		<pubDate>Sun, 04 Oct 2009 11:42:07 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56402</guid>
		<description>Thanks Sir...
Big help</description>
		<content:encoded><![CDATA[<p>Thanks Sir&#8230;<br />
Big help</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zee</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56385</link>
		<dc:creator>zee</dc:creator>
		<pubDate>Sat, 03 Oct 2009 19:29:04 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56385</guid>
		<description>zee

Select RNo+2 As RNo,FName From DBtab
Where FName=&#039;lia&#039;</description>
		<content:encoded><![CDATA[<p>zee</p>
<p>Select RNo+2 As RNo,FName From DBtab<br />
Where FName=&#8217;lia&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: zee</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56384</link>
		<dc:creator>zee</dc:creator>
		<pubDate>Sat, 03 Oct 2009 19:26:58 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56384</guid>
		<description>zee

Select * from  table name
where Fname like &#039;%a%&#039; and Fname like &#039;_li&#039;
 
i hope you like it</description>
		<content:encoded><![CDATA[<p>zee</p>
<p>Select * from  table name<br />
where Fname like &#8216;%a%&#8217; and Fname like &#8216;_li&#8217;</p>
<p>i hope you like it</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: anurag</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56299</link>
		<dc:creator>anurag</dc:creator>
		<pubDate>Thu, 01 Oct 2009 04:28:41 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56299</guid>
		<description>how do i know the structure of table like in mysql or oracle viz desc.i uses sp_privileges but it return the result that i dont want. i want to know the data type and its size</description>
		<content:encoded><![CDATA[<p>how do i know the structure of table like in mysql or oracle viz desc.i uses sp_privileges but it return the result that i dont want. i want to know the data type and its size</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: NebWright</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56085</link>
		<dc:creator>NebWright</dc:creator>
		<pubDate>Wed, 23 Sep 2009 12:40:29 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-56085</guid>
		<description>Appreciate your blog. Does anyone have any ideas on how to lookup the source table/column associated with a column in a given view? I&#039;m looking for a way to map a column from a view (that shows up in syscolumns) back to the originating table and column that the view column is based on.</description>
		<content:encoded><![CDATA[<p>Appreciate your blog. Does anyone have any ideas on how to lookup the source table/column associated with a column in a given view? I&#8217;m looking for a way to map a column from a view (that shows up in syscolumns) back to the originating table and column that the view column is based on.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ambanna</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-55779</link>
		<dc:creator>Ambanna</dc:creator>
		<pubDate>Thu, 10 Sep 2009 18:32:06 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-55779</guid>
		<description>you can use this,
sp_msforeachtable &#039;sp_help [?]&#039;</description>
		<content:encoded><![CDATA[<p>you can use this,<br />
sp_msforeachtable &#8217;sp_help [?]&#8216;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sourabh Sachdeva</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-55765</link>
		<dc:creator>Sourabh Sachdeva</dc:creator>
		<pubDate>Thu, 10 Sep 2009 09:29:39 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-55765</guid>
		<description>Hi suyog,

     
              Not a proper way but i think u can use

declare @tableName as varchar(100)
declare @countValues as int
select @tableName=name from sys.tables
select @countValues=COUNT(*) from sys.tables
declare @startvalue as int
set @startvalue=1
while @startvalue&lt;@countValues
begin
declare @exe as varchar(100)
set @exe=&#039;sp_help &#039;+@tableName+&#039;&#039;
print @exe
exec(@exe)
set @startvalue=@startvalue+1
end

after executing these statements you can see all tables structure info. If you want to combine all data into single resultset you can use temporary tables etc..</description>
		<content:encoded><![CDATA[<p>Hi suyog,</p>
<p>              Not a proper way but i think u can use</p>
<p>declare @tableName as varchar(100)<br />
declare @countValues as int<br />
select @tableName=name from sys.tables<br />
select @countValues=COUNT(*) from sys.tables<br />
declare @startvalue as int<br />
set @startvalue=1<br />
while @startvalue&lt;@countValues<br />
begin<br />
declare @exe as varchar(100)<br />
set @exe=&#039;sp_help &#039;+@tableName+&#039;&#039;<br />
print @exe<br />
exec(@exe)<br />
set @startvalue=@startvalue+1<br />
end</p>
<p>after executing these statements you can see all tables structure info. If you want to combine all data into single resultset you can use temporary tables etc..</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sourabh Sachdeva</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-55746</link>
		<dc:creator>Sourabh Sachdeva</dc:creator>
		<pubDate>Wed, 09 Sep 2009 10:10:47 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-55746</guid>
		<description>hi suyog,


If you want to see structure of all tables you can use:


 select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME in(select TABLE_NAME from INFORMATION_SCHEMA.TABLES)

If you want to see index details then you can use:

select name,type_desc from sys.objects where type=&#039;PK&#039;</description>
		<content:encoded><![CDATA[<p>hi suyog,</p>
<p>If you want to see structure of all tables you can use:</p>
<p> select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME in(select TABLE_NAME from INFORMATION_SCHEMA.TABLES)</p>
<p>If you want to see index details then you can use:</p>
<p>select name,type_desc from sys.objects where type=&#8217;PK&#8217;</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Suyog</title>
		<link>http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-55743</link>
		<dc:creator>Suyog</dc:creator>
		<pubDate>Wed, 09 Sep 2009 08:34:01 +0000</pubDate>
		<guid isPermaLink="false">http://blog.sqlauthority.com/2007/06/26/sql-server-2005-list-all-tables-of-database/#comment-55743</guid>
		<description>Dear Sir,
 that query is not showing me index ,constraints,columns details...
is there any other way..except sp_help tablename..

can we go for sp_msforeachtable???
can u plz provide exact query for same..</description>
		<content:encoded><![CDATA[<p>Dear Sir,<br />
 that query is not showing me index ,constraints,columns details&#8230;<br />
is there any other way..except sp_help tablename..</p>
<p>can we go for sp_msforeachtable???<br />
can u plz provide exact query for same..</p>
]]></content:encoded>
	</item>
</channel>
</rss>
