CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Apr 2003
    Location
    India
    Posts
    17

    Question Source of Views and SPs in SQL Server

    Hi,

    I have a small problem. I would like to get the source of views and stored procedures in my SQL Server 7 database right from VB. Is it possible? I know that in query analyzer by issuing the command sp_helptext, I will get the source. But how from VB? Any help is very much appreciated.

    Thanks in advance

    Kishore

  2. #2
    Join Date
    Jan 2000
    Location
    Olen, Belgium
    Posts
    2,477
    Well, you can call sp_helptext from vb through an open database connection to the server.
    Another place where you can get this data is in the system table syscomments, wich holds the command text used to cretae the stored procedure/view. To get that, you will probably need to do a select on sysobjects first, to get the objectid of the object you are interested in.
    Tom Cannaerts
    email: [email protected]
    www.tom.be (dutch site)

  3. #3
    Join Date
    Apr 2003
    Location
    India
    Posts
    17

    Smile Thanks

    Hi,

    Thank u very much. It solved my problem

    Kishore

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured