Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Extracting Stored Procs to create a create proc script

Status
Not open for further replies.

Dudek

Technical User
Jan 14, 2002
27
MY
Hi there

simple question

Is there any way to generate a script to recreate all the stored procs
that are in the database?

I have tried using the syscomments table, but the text field truncates
the stored proc as it is only varchar 255

What i need is to generate a script that would look like...

create proc procedure1
...
end
go

create proc procedure2
...
end
go

where the procs procedure1 and procedure2 are in the database.
Anyone?
TIA
JD
 
yup.. it can be done through sybase central, but what i need is a script that will automatically do it?

any one can help me here?

JD
 
Yes, this can be handled in many ways. defncopy is a sybase provided UNIX utility that can help you out with a copy of the Stored Procs on the database. There are other softwares like wisql2, sybase central etc which can help on this too.
If nothing works for you, you can use sp_helpsegment 'name' redirected to an output file. But the formatting is distorted using this method.
S.Rajesh
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top