Question : Sybase stored procedure extract with wrappers

All,

I know DEFNCOPY can extract the contents of a stored procedure but is there a way to include get the header and footer (security) wrappers of the stored procedure?

Something like:

IF OBJECT_ID('dbo.MYTEST) IS NOT NULL
BEGIN
    DROP PROCEDURE dbo.MYTEST
    IF OBJECT_ID('dbo.MYTEST') IS NOT NULL
        PRINT '<<< FAILED DROPPING PROCEDURE dbo.MYTEST >>>'
    ELSE
        PRINT '<<< DROPPED PROCEDURE dbo.MYTEST >>>'
END
go

the CREATE PROCEDURE and everything after it comprising the stored procedure can extracted using DEFNCOPY but then I have the security footer wrapper like...

IF OBJECT_ID('dbo.MYTEST) IS NOT NULL
    PRINT '<<< CREATED PROCEDURE dbo.MYTEST >>>'
ELSE
    PRINT '<<< FAILED CREATING PROCEDURE dbo.MYTEST >>>'
go
EXEC sp_procxmode 'dbo.MYTEST','unchained'
go

Is there a way or tool that can extract out all that information in an automated fashion?  I'm trying to write a script to pull that appropriate information and to create files of the stored procedures.  DEFNCOPY only gave me part of it but I'm looking for the other part too.  

Any assistance would be greatly appreciated.

Answer : Sybase stored procedure extract with wrappers

I always use the Sybase central DDLGEN. But our unix server has same binary file which is named as ddlgen. I confirmed with my DBA about this command and they told me that this utility is working.

Make sure your client machine has all necessary path has been setuped poperly.

So try it out.  Good luck !!!

Random Solutions  
 
programming4us programming4us