用ddlgen生成对象脚本
Getting the DDLThe lesson started with showing how you can get the DDL for an object, you can use Sybase Central to do this or you can use the ddlgen Utility. Sybase Central is similar to SSMS, you right click on the object and select the Generate DDL option. The ddlgen utility is a Java based command line toolSyntax looks like thisddlgen -Ulogin -Ppassword -S [-I interfaces_file] [-Tobject_type] [-Nobject_name] [-Ddbname] [-Xextended_object_type] [-Ooutput_file] [-Eerror_file] [-Lprogress_log_file] [-Jclient_charset] -F[ % | SGM | GRP | USR | R | D | UDD | U | V | P | XP | I | RI | KC | TR | PC ]Here is what object_type (switch T) can beObject type Description------------ ------------------C cacheD defaultDB databaseDBD database deviceDPD dump deviceEC execution classEG engine groupEK encrypted keysGRP groupI indexKC key constraintsL loginLK logical keyP stored procedureR ruleRI referential integrityRO roleRS remote serverSGM segmentTR triggerU tableUDD user-defined datatypeUSR userV viewWS user-defined Web serviceWSC Web service consumerXP extended stored procedureHere are two examples. Both of these generate DDL for the primary and unique keys of all the tables in a database that begin with “PK”:ddlgen -Ulogin -Ppassword -TKC -Ndbname.%.%.PK%Or:ddlgen -Ulogin -Ppassword -TKC -N%.%.PK% -Ddbname
页:
[1]