logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

defncopy — extract procedures and views from a Microsoft server.

Authors

       The defncopy utility was written by James K. Lowden <jklowden@schemamania.org.>

Bugs

       Works only with Microsoft servers and ancient Sybase  servers.   Does  not  create  primary  keys.   Many
       options  are defined by Sybase that this version does not implement. Feel free to correct this situation.
       In theory, defncopy could apply/produce DDL for any system object, but at present only tables, procedures
       and views are supported, and only for extraction.

FreeTDS 1.3.17                                   April 26, 2012                                DEFNCOPY(FreeTDS)

Description

defncopy is a utility program distributed with FreeTDS. It replaces a similar program of  the  same  name
       distributed by Sybase.

       defncopy  reads  the  text of a stored procedure or view, and writes a script suitable for recreating the
       procedure or view. For tables, it reads the output of sp_help and constructs a ‘CREATE TABLE’  statement,
       complete  with  ‘CREATE  INDEX’, too.  owner is optional if you or the database owner is the owner of the
       procedure/view being copied.  object_name is the name of the system object you wish to extract.

Exit Status

defncopy exits 0 on success, and >0 if the server cannot process the query.

       defncopy will report any errors returned by the server, but will continue processing.

History

defncopy first appeared in FreeTDS 0.63.

Name

       defncopy — extract procedures and views from a Microsoft server.

Notes

defncopy is a filter; it reads from standard input, writes to  standard  output,  and  writes  errors  to
       standard error. The -i, -o, and -e options override these defaults.

       defncopy  makes  use  of  the  db-lib  API  provided  by FreeTDS. This API is of course also available to
       application developers.

Options

-Uusername
               database server login name.

       -Ppassword
               database server password.

       -Sserver
               database server to which to connect.

       -Ddatabase
               database to use. Optional if the procedure/view being extracted is in your default database.

       -iinput_file
               a script to apply to the database. Not currently implemented.

       -ooutput_file
               a file to hold the script, defaults to standard output.

       -v      Show version information and copyright notice.

Synopsis

defncopy  [-v]  [-Uusername]  [-Ppassword] [-Sserver] [-Ddatabase] [-iinput_file] [-ooutput_file]
                [owner.object_name [owner.object_name...]]

return

See Also