Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2006
    Posts
    58

    Unanswered: How to get the scripts of Procedure

    Hello, nice to see you here again.
    Here is a problem, please give me some help.

    I have gotten the scripts of tables with Meta Data. We can select meta data from the table sys.objects and sys.cloumns.

    -----SQL-------
    SELECT T1.name table_name, T2.name fields_name,T2.length
    FROM dbo.sysobjects T1
    INNER JOIN dbo.syscolumns T2
    ON T1.id = T2.id
    WHERE T1.xtype = 'U'
    ORDER BY T1.name

    --------Result-------------
    A_A a 1000


    I want to get the script of procedure with Meta data in SQL SERVER 2000 in SQL statements as above. But how can I do? Thank you very much!

  2. #2
    Join Date
    Jun 2004
    Location
    Long Island
    Posts
    696
    text from syscomments
    or
    sp_helptext 'objectname'

    I do the latter, wrap it in a .cmd script and pass the objectname via a for loop and redirect output to objectname.sql
    Last edited by PMASchmed; 02-13-09 at 18:21.

  3. #3
    Join Date
    Aug 2006
    Posts
    58
    PMASchmed,thank you very much!I have gotten with your given method.

Posting Permissions

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