EXEC sp_help <name> : EXEC « Store Procedure Function « SQL Server / T-SQL

SQL Server / T-SQL
1. Aggregate Functions
2. Analytical Functions
3. Constraints
4. Cursor
5. Data Set
6. Data Type
7. Database
8. Date Timezone
9. Index
10. Insert Delete Update
11. Math Functions
12. Select Query
13. Sequence
14. Store Procedure Function
15. String Functions
16. Subquery
17. System
18. Table
19. Table Joins
20. Transact SQL
21. Transaction
22. Trigger
23. View
24. XML
Java
Java Tutorial
Java Source Code / Java Documentation
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
C# / C Sharp
C# / CSharp Tutorial
ASP.Net
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
PHP
Python
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
SQL Server / T-SQL » Store Procedure Function » EXEC 
EXEC sp_help <name>

 


To view the properties of the sales table, we just have to type the following into the Query Analyzer:

8CREATE TABLE stores(
9>    stor_id        char(4)           NOT NULL,
10>    stor_name      varchar(40)           NULL,
11>    stor_address   varchar(40)           NULL,
12>    city           varchar(20)           NULL,
13>    state          char(2)               NULL,
14>    zip            char(5)               NULL
15)
16> GO
1>    EXEC sp_help stores
2>    GO
Name                                                                                                                             Owner
                                                          Type                            Created_datetime
-------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------
--------------------------------------------------------- ------------------------------- -----------------------
stores                                                                                                                           dbo
                                                          user table                      2008-08-17 13:04:38.290


Column_name                                                                                                                      Type
                                                          Computed                            Length      Prec  Scale Nullable                            TrimTrailingBlanks                  FixedLenNu
llInSource                Collation
-------------------------------------------------------------------------------------------------------------------------------- -----------------------------------------------------------------------
--------------------------------------------------------- ----------------------------------- ----------- ----- ----- ----------------------------------- ----------------------------------- ----------
------------------------- --------------------------------------------------------------------------------------------------------------------------------
stor_id                                                                                                                          char
                                                          no                                            4             no                                  no                                  no
                          SQL_Latin1_General_CP1_CI_AS
stor_name                                                                                                                        varchar
                                                          no                                           40             yes                                 no                                  yes
                          SQL_Latin1_General_CP1_CI_AS
stor_address                                                                                                                     varchar
                                                          no                                           40             yes                                 no                                  yes
                          SQL_Latin1_General_CP1_CI_AS
city                                                                                                                             varchar
                                                          no                                           20             yes                                 no                                  yes
                          SQL_Latin1_General_CP1_CI_AS
state                                                                                                                            char
                                                          no                                            2             yes                                 no                                  yes
                          SQL_Latin1_General_CP1_CI_AS
zip                                                                                                                              char
                                                          no                                            5             yes                                 no                                  yes
                          SQL_Latin1_General_CP1_CI_AS

Identity                                                                                                                         Seed                                     Increment
           Not For Replication
-------------------------------------------------------------------------------------------------------------------------------- ---------------------------------------- ------------------------------
---------- -------------------
No identity column defined.                                                                                                                                          NULL
      NULL                NULL

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

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

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

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

No foreign keys reference table 'stores', or you do not have permissions on referencing tables.
No views with schema binding reference table 'stores'.
1>
2>
3> drop table stores;
4> GO

 
Related examples in the same category
1. EXEC: execute a select statement
2. Example of Dynamic Database Context with EXEC()
3. You can specify the parameters by name.
4. Execute a system function
5. Use of Functions in Sql statement Concatenation and EXEC
www.java2java.com | Contact Us
Copyright 2010 - 2030 Java Source and Support. All rights reserved.
All other trademarks are property of their respective owners.