EXEC sp_helptext on a view : sp_helptext « System Functions « SQL Server / T-SQL Tutorial






2>
3>
4> CREATE TABLE Shippers (
5>      ShipperID int NOT NULL ,
6>      CompanyName nvarchar (40) NOT NULL ,
7>      Phone nvarchar (24) NULL
8> )
9> GO
1>
2>
3> INSERT Shippers VALUES(1,'Express','(503) 555-9831')
4> INSERT Shippers VALUES(2,'Package','(503) 555-3199')
5> INSERT Shippers VALUES(3,'Shipping','(503) 555-9931')
6> go

(1 rows affected)

(1 rows affected)

(1 rows affected)
1>
2>    CREATE VIEW OregonShippers_vw
3>    AS
4>    SELECT   ShipperID,
5>             CompanyName,
6>             Phone
7>    FROM     Shippers
8>    WHERE Phone LIKE '(503)%'
9>    WITH CHECK OPTION
10> GO
1>
2>
3>
4>
5> EXEC sp_helptext OregonShippers_vw;
6>
7> drop view OregonShippers_vw;
8> GO
Text

--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-------------------------------------------------------



   CREATE VIEW OregonShippers_vw


   AS


   SELECT   ShipperID,


            CompanyName,


            Phone


   FROM     Shippers


   WHERE Phone LIKE '(503)%'


   WITH CHECK OPTION


1>
2> drop table Shippers;
3> GO
1>








25.46.sp_helptext
25.46.1.Displays the contents of a stored procedure, a trigger, or a view.
25.46.2.How to use the sp_HelpText system stored procedure
25.46.3.EXEC sp_helptext on a view
25.46.4.The sp_helptext system stored procedure gives you a source listing of another procedure, if it was not created with the WITH ENCRYPTION option.