If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Database Server Software > Sybase > Extract all SPs , Triggers to output file at one shot

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 04-25-11, 02:34
Devaprakash Devaprakash is offline
Registered User
 
Join Date: Apr 2011
Posts: 2
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.....!!!
Reply With Quote
  #2 (permalink)  
Old 04-25-11, 23:07
kayakbuilder kayakbuilder is offline
Registered User
 
Join Date: Apr 2011
Location: WA
Posts: 6
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
Reply With Quote
  #3 (permalink)  
Old 04-25-11, 23:17
kayakbuilder kayakbuilder is offline
Registered User
 
Join Date: Apr 2011
Location: WA
Posts: 6
also

If you want to generate the drop statements too

substitute
' exec sp_helptext @name, 2048, 1, "showsql, ddlgen" '
for
' exec sp_showtext @name '
Reply With Quote
  #4 (permalink)  
Old 04-26-11, 02:54
pdreyer pdreyer is offline
Registered User
 
Join Date: May 2005
Location: South Africa
Posts: 1,268
use the ddlgen command line utility
Reply With Quote
  #5 (permalink)  
Old 04-27-11, 09:30
Devaprakash Devaprakash is offline
Registered User
 
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.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On