1FreeTDS(May 14, 2011)                                    FreeTDS(May 14, 2011)
2
3
4

NAME

6       defncopy - extract procedures and views from a Microsoft server.
7

SYNOPSIS

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

DESCRIPTION

14       defncopy  is  a utility program distributed with FreeTDS. It replaces a
15       similar program of the same name distributed by Sybase.
16
17       defncopy reads the text of a stored procedure or  view,  and  writes  a
18       script  suitable  for  recreating the procedure or view. For tables, it
19       reads the output of sp_help and constructs a  CREATE  TABLE  statement,
20       complete with CREATE INDEX, too.
21

OBJECTS

23       owner  is  optional  if  you  or the database owner is the owner of the
24              procedure/view being copied.
25
26       object_name
27              is the name of the system object you wish to extract.
28

OPTIONS

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

NOTES

52       defncopy  is a filter; it reads from standard input, writes to standard
53       output, and writes errors to standard error.  The  -i  and  -o  options
54       override these, of course.
55
56       defncopy  makes  use of the db-lib API provided by FreeTDS. This API is
57       of course also available to application developers.
58

EXIT STATUS

60       defncopy exits 0 on success, and >0 if the server  cannot  process  the
61       query.
62
63       defncopy  will  report any errors returned by the server, but will con‐
64       tinue processing.
65

HISTORY

67       defncopy first appeared in FreeTDS 0.63.
68

AUTHORS

70       The defncopy utility was written by James K. Lowden <jklowden@schemama‐
71       nia.org>
72

BUGS

74       Works only with Microsoft servers and ancient Sybase servers.
75
76       Does not create primary keys.
77
78       Many  options  are  defined by Sybase that this version does not imple‐
79       ment. Feel free to correct this situation.
80
81       In theory, defncopy could apply/produce DDL for any system object,  but
82       at  present  only  tables, procedures and views are supported, and only
83       for extraction.
84
85
86
87FreeTDS Utilities                   0.91RC2              FreeTDS(May 14, 2011)
Impressum