﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Article Discussions by Author / Discuss content posted by VM  / sp_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>Sun, 26 May 2013 03:24:50 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Nice question, thanks!</description><pubDate>Fri, 03 Dec 2010 13:41:41 GMT</pubDate><dc:creator>UMG Developer</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Thanks Hugo. I have forgotten how to read.</description><pubDate>Thu, 02 Dec 2010 12:26:09 GMT</pubDate><dc:creator>croberts 36762</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>You're doing nothing wrong. This is the expected and documented behaviour for sys.tables.Note that this discussion is about the system stored procedure [i]sp_tables[/i], not about the catalog view [i]sys.tables[/i].</description><pubDate>Thu, 02 Dec 2010 12:20:54 GMT</pubDate><dc:creator>Hugo Kornelis</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>When I do a 'select * from sys.tables' on a database with views, only the tables are returned, not the views. This is on SQL 2005. What am I doing wrong? Can someone verify this?</description><pubDate>Thu, 02 Dec 2010 08:33:02 GMT</pubDate><dc:creator>croberts 36762</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Nice straightforward question, no tricks or traps.  Pity that the MS documentation has fallen out of date, though.</description><pubDate>Wed, 01 Dec 2010 05:42:06 GMT</pubDate><dc:creator>L' Eomot Inversé</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>[quote][b]payalvyas11 (11/30/2010)[/b][hr]I too answered incorrectly after reading the documentation of msdn. The statment "any object that can appear in a FROM clause, except synonym objects", made me assume that user defined functions too would be included.[/quote]True, the documentation can be confusing, but if you've read further, you would have noticed by result sets: TABLE_TYPE --&amp;gt; table, system table or view.This leaves very little doubt of course.</description><pubDate>Wed, 01 Dec 2010 00:37:22 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Good question. Keep it up.</description><pubDate>Tue, 30 Nov 2010 23:44:03 GMT</pubDate><dc:creator>jaganmohan.rao</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>I too answered incorrectly after reading the documentation of msdn. The statment "any object that can appear in a FROM clause, except synonym objects", made me assume that user defined functions too would be included.</description><pubDate>Tue, 30 Nov 2010 11:00:35 GMT</pubDate><dc:creator>payal vyas</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Nice Question!  I liked the way I learned something from the answer. Never tought before about how it lists System Tables as a TABLE object even though they are differant from user created TABLE objects.:cool:</description><pubDate>Tue, 30 Nov 2010 10:12:06 GMT</pubDate><dc:creator>SanDroid</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Nice question, thanks.</description><pubDate>Tue, 30 Nov 2010 10:04:42 GMT</pubDate><dc:creator>Koen Verbeeck</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>[quote][b]sknox (11/30/2010)[/b][hr]Hugo, I do hope that you've posted the same excellent analysis as a comment to the Microsoft documentation... :-P[/quote]Thanks! ;-)And no, I did not. But I did submit it as feedback to the article, so that it will hopefully be fixed.</description><pubDate>Tue, 30 Nov 2010 08:36:19 GMT</pubDate><dc:creator>Hugo Kornelis</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Oh men, i was thinking about table valued functions and i answer incorrectly, they can be in a "from" clause. I was being very literal, surely msdn did not mean an absolute "everything that can be in a from clause".</description><pubDate>Tue, 30 Nov 2010 07:45:38 GMT</pubDate><dc:creator>adrian.facio</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Hugo, I do hope that you've posted the same excellent analysis as a comment to the Microsoft documentation... :-P</description><pubDate>Tue, 30 Nov 2010 07:40:39 GMT</pubDate><dc:creator>sknox</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>An interesting question.I will not debate the quality of the question, but I will debate the quality of the documentation. Not the documentation that is linked to (this is a very old description, pointing to the SQL Server 2000 version of Books Online), but to the current version (found [url=http://msdn.microsoft.com/en-us/library/ms186250.aspx]here[/url]), that is almost identical.The description in BOL explicitly mentions the three types that were also the answer to this question: tbales, views, and system tables. But as of SQL Server 2005, system tables no longer exist - or rather, they do exist, but are completely hidden from view. They have been replaced by system views. These are returned by sp_tables - as views, not as system tables. So since SQL Server 2005, sp_tables no longer returns objects of the type SYSTEMTABLE.The same description in BOL also says that sp_tables, and I quote, "Returns a list of objects that can be queried in the current environment. This means any object that can appear in a FROM clause, except synonym objects". If that were true, then [b]some[/b] user-defined functions should be included as well, namely all table-valued functions. This is not the case.My guess is that sp_tables has not been touched since SQL Server 2000. Neither the procedure, nor the documentation has been changed. And noone has noticed that, in spite of the lack of changes, external changes have made the documentation go out of sync.Thanks for the interesting question, VM - I had never heard of this system stored procedure before. (And I'll probably forget about it within a few days;-)).</description><pubDate>Tue, 30 Nov 2010 01:52:01 GMT</pubDate><dc:creator>Hugo Kornelis</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Check the bellow link for this topichttp://searchsqlserver.techtarget.com/tip/Stored-procedure-List-SQL-Server-database-objects-by-selected-typesYousaf Khan</description><pubDate>Tue, 30 Nov 2010 01:10:38 GMT</pubDate><dc:creator>Yousaf Khan</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>simple one today ;)</description><pubDate>Tue, 30 Nov 2010 00:11:51 GMT</pubDate><dc:creator>sharath.chalamgari</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Straight-forward, simple, yet important question.Thanks!</description><pubDate>Mon, 29 Nov 2010 23:07:49 GMT</pubDate><dc:creator>Nakul Vachhrajani</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Thanks for the question.</description><pubDate>Mon, 29 Nov 2010 23:03:44 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Very straight forward question. Thanks.</description><pubDate>Mon, 29 Nov 2010 21:28:52 GMT</pubDate><dc:creator>Hardy21</dc:creator></item><item><title>sp_tables</title><link>http://www.sqlservercentral.com/Forums/Topic1027714-1495-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/questions/Administration/71563/"&gt;sp_tables&lt;/A&gt;[/B]</description><pubDate>Mon, 29 Nov 2010 21:19:43 GMT</pubDate><dc:creator>VM-723206</dc:creator></item></channel></rss>