EXEC sp_help on a table : sp_help « System Functions « SQL Server / T-SQL Tutorial

SQL Server / T-SQL Tutorial
1. Query
2. Insert Delete Update
3. Table
4. Table Join
5. Data Types
6. Set Operations
7. Constraints
8. Subquery
9. Aggregate Functions
10. Date Functions
11. Math Functions
12. String Functions
13. Data Convert Functions
14. Analytical Functions
15. Sequence Indentity
16. View
17. Index
18. Cursor
19. Database
20. Transact SQL
21. Procedure Function
22. Trigger
23. Transaction
24. XML
25. System Functions
26. System Settings
27. System Tables Views
28. User Role
29. CLR
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
SQL Server / T-SQL Tutorial » System Functions » sp_help 
25. 41. 2. EXEC sp_help on a table
4>    CREATE TABLE Customers
5>    (
6>       CustomerNo    int         IDENTITY  NOT NULL,
7>       CustomerName  varchar(30)                NOT NULL,
8>       Address1      varchar(30)                NOT NULL,
9>       Address2      varchar(30)                NOT NULL,
10>       City          varchar(20)                NOT NULL,
11>       State         char(2)                    NOT NULL,
12>       Zip           varchar(10)                NOT NULL,
13>       Contact       varchar(25)                NOT NULL,
14>       Phone         char(15)                   NOT NULL,
15>       FedIDNo       varchar(9)                 NOT NULL,
16>       DateInSystem  smalldatetime              NOT NULL
17>    )
18>    GO
1>    EXEC sp_help Customers
2> GO
Name                                                                                                                             Owner
                                                          Type                            Created_datetime
-------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------
--------------------------------------------------------- ------------------------------- -----------------------
Customers                                                                                                                        dbo
                                                          user table                      2008-08-18 20:36:02.103


Column_name                                                                                                                      Type
                                                          Computed                            Length      Prec  Scale Nullable                            TrimTrailingBlanks                  FixedLenNu
llInSource                Collation
-------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------
--------------------------------------------------------- ----------------------------------- ----------- ----- ----- ----------------------------------- ----------------------------------- ----------
------------------------- --------------------------------------------------------------------------------------------------------------------------------
CustomerNo                                                                                                                       int
                                                          no                                            4 10    0     no                                  (n/a)                               (n/a)
                          NULL
CustomerName                                                                                                                     varchar
                                                          no                                           30             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
Address1                                                                                                                         varchar
                                                          no                                           30             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
Address2                                                                                                                         varchar
                                                          no                                           30             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
City                                                                                                                             varchar
                                                          no                                           20             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
State                                                                                                                            char
                                                          no                                            2             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
Zip                                                                                                                              varchar
                                                          no                                           10             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
Contact                                                                                                                          varchar
                                                          no                                           25             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
Phone                                                                                                                            char
                                                          no                                           15             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
FedIDNo                                                                                                                          varchar
                                                          no                                            9             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
DateInSystem                                                                                                                     smalldatetime
                                                          no                                            4             no                                  (n/a)                               (n/a)
                          NULL

Identity                                                                                                                         Seed                                     Increment
           Not For Replication
-------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------- ------------------------------
---------- -------------------
CustomerNo                                                                                                                                                              1
         1                   0

RowGuidCol
--------------------------------------------------------------------------------------------------------------------------------
No rowguidcol column defined.

Data_located_on_filegroup
--------------------------------------------------------------------------------------------------------------------------------
PRIMARY

The object 'Customers' does not have any indexes, or you do not have permissions.

No constraints are defined on object 'Customers', or you do not have permissions.

No foreign keys reference table 'Customers', or you do not have permissions on referencing tables.
No views with schema binding reference table 'Customers'.
1>
2> drop table Customers;
3> GO
1>
25. 41. sp_help
25. 41. 1. The system procedure sp_help displays information about one or more database objects.
25. 41. 2. EXEC sp_help on a table
25. 41. 3. Display table structure before and after altering command
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.