1FreeTDS(February 24, 2006)                          FreeTDS(February 24, 2006)
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
21
22       with CREATE INDEX, too.
23              It does not create primary keys (although it could, patches wel‐
24              come).
25
26       defncopy makes use of the db-lib API provided by FreeTDS. This  API  is
27       of course also available to application developers.
28

OBJECTS

30       owner  is  optional  if  you  or the database owner is the owner of the
31              procedure/view being copied.
32
33       object_name
34              is the name of the system object you wish to extract.
35

OPTIONS

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

NOTES

59       defncopy  is a filter; it reads from standard input, writes to standard
60       output, and writes errors to standard error.  The  -i  and  -o  options
61       override these, of course.
62

EXIT STATUS

64       defncopy  exits  0  on success, and >0 if the server cannot process the
65       query.
66
67       defncopy will report any errors returned by the server, but  will  con‐
68       tinue processing.
69

HISTORY

71       defncopy first appeared in FreeTDS 0.63.
72

AUTHORS

74       The defncopy utility was written by James K. Lowden <jklowden@schemama‐
75       nia.org>
76

BUGS

78       Works only with Microsoft servers and ancient Sybase servers.
79
80       Many options are defined by Sybase that this version  does  not  imple‐
81       ment. Feel free to correct this situation.
82
83       In  theory, defncopy could apply/produce DDL for any system object, but
84       at present only tables, procedures and views are  supported,  and  only
85       for extraction.
86
87
88
89FreeTDS Utilities                   0.64RC1         FreeTDS(February 24, 2006)
Impressum