Results 1 to 5 of 5
  1. #1
    Join Date
    Apr 2011
    Posts
    2

    Unanswered: Extract all SPs , Triggers to output file at one shot

    Hi All,

    I am just a newbie to sybase.
    Just like Generate Scripts in MS SQL 2005 , Is there any way to extract all SPs,Triggers into output file from sysbase at one shot.
    I am using Embarcadero Rapid SQL V7.6.4

    Please help me out.....!!!

  2. #2
    Join Date
    Apr 2011
    Location
    WA
    Posts
    8

    proc to generate procs and triggers

    drop proc generateScripts

    go

    create proc generateScripts

    as


    declare @name varchar(255)

    declare scriptCursor cursor

    for

    select name

    from sysobjects

    where type in ('p', 'tr')


    open scriptCursor


    fetch scriptCursor into @name

    while @@sqlstatus = 0

    begin

    exec sp_showtext @name

    fetch scriptCursor into @name

    end


    Close scriptCursor

    deallocate cursor scriptCursor

  3. #3
    Join Date
    Apr 2011
    Location
    WA
    Posts
    8

    also

    If you want to generate the drop statements too

    substitute
    ' exec sp_helptext @name, 2048, 1, "showsql, ddlgen" '
    for
    ' exec sp_showtext @name '

  4. #4
    Join Date
    May 2005
    Location
    South Africa
    Posts
    1,365
    Provided Answers: 1
    use the ddlgen command line utility

  5. #5
    Join Date
    Apr 2011
    Posts
    2
    Thank you guys for your kind reply.
    Actually i used DbArtisan to extract all SPs into ouput (.sql) file
    But now my requirement is that i need to get each and every SPs & triggers into each sql output file.

    ie., I have 2254 sps so i need to generate 2254 output (.sql) files.

    Is there any way to do so ? Please do help me...

    Kind Regards
    Deva.

Posting Permissions

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