SHOW TABLES

SHOW TABLES displays information about all visible lists in the site. The result table provides valuable information that can be useful in many programming scenarios, such as when a list was created, last modified or how many items a list currently contains. The SHOW LISTS command is a synonym for SHOW TABLES.

This command always return same columns. For the complete listing see the SHOW TABLE reference.

Syntax

SHOW {TABLES | LISTS};

Code example: Get all lists and libraries in a site and print name and type. Generic lists have type 0 and document libraries have type 1.

Print lists and libraries

using (var connection = new SharePointConnection(connectionString))
{
    connection.Open();
    using (var command = new SharePointCommand("SHOW TABLES", connection))
    {
        using (var reader = command.ExecuteReader())
        {
            while (reader.Read())
            {
                Console.WriteLine(reader["Title"].ToString().PadRight(40) + " : " + reader["BaseType"].ToString());
            }
        }
    }
}

Code result

Announcements                            : 0
Calendar                                 : 0
Content type publishing error log        : 0
Converted Forms                          : 1
Customized Reports                       : 1
Form Templates                           : 1
Links                                    : 0
List Template Gallery                    : 1
Master Page Gallery                      : 1
Reporting Metadata                       : 0
Reporting Templates                      : 1
Shared Documents                         : 1
Site Assets                              : 1
Site Pages                               : 1
Solution Gallery                         : 1
Style Library                            : 1
Tasks                                    : 0
TaxonomyHiddenList                       : 0
Team Discussion                          : 0
Theme Gallery                            : 1
User Information List                    : 0
Web Part Gallery                         : 1
wfpub                                    : 1


Skip Navigation Links.

Visa     MasterCard