1DEFNCOPY(FreeTDS)          FreeTDS Reference Manual          DEFNCOPY(FreeTDS)
2

NAME

4     defncopy — extract procedures and views from a Microsoft server.
5

SYNOPSIS

7     defncopy [-v] [-U username] [-P password] [-S server] [-D database]
8              [-i input_file] [-o output_file] [owner.object_name
9              [owner.object_name ...]]
10

DESCRIPTION

12     defncopy is a utility program distributed with FreeTDS. It replaces a
13     similar program of the same name distributed by Sybase.
14
15     defncopy reads the text of a stored procedure or view, and writes a
16     script suitable for recreating the procedure or view. For tables, it
17     reads the output of sp_help and constructs a ‘CREATE TABLE’ statement,
18     complete with ‘CREATE INDEX’, too.  owner is optional if you or the data‐
19     base owner is the owner of the procedure/view being copied.  object_name
20     is the name of the system object you wish to extract.
21

OPTIONS

23     -U username
24             database server login name.
25
26     -P password
27             database server password.
28
29     -S server
30             database server to which to connect.
31
32     -D database
33             database to use. Optional if the procedure/view being extracted
34             is in your default database.
35
36     -i input_file
37             a script to apply to the database. Not currently implemented.
38
39     -o output_file
40             a file to hold the script, defaults to standard output.
41
42     -v      Show version information and copyright notice.
43

NOTES

45     defncopy is a filter; it reads from standard input, writes to standard
46     output, and writes errors to standard error. The -i, -o, and -e options
47     override these defaults.
48
49     defncopy makes use of the db-lib API provided by FreeTDS. This API is of
50     course also available to application developers.
51

EXIT STATUS

53     defncopy exits 0 on success, and >0 if the server cannot process the
54     query.
55
56     defncopy will report any errors returned by the server, but will continue
57     processing.
58

HISTORY

60     defncopy first appeared in FreeTDS 0.63.
61

AUTHORS

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

BUGS

67     Works only with Microsoft servers and ancient Sybase servers.  Does not
68     create primary keys.  Many options are defined by Sybase that this ver‐
69     sion does not implement. Feel free to correct this situation.  In theory,
70     defncopy could apply/produce DDL for any system object, but at present
71     only tables, procedures and views are supported, and only for extraction.
72
73FreeTDS 1.1.20                  April 26, 2012                  FreeTDS 1.1.20
Impressum