DEFNCOPY(1)
πΈ NAME πΈ
okay bestie, this is the defncopy page β LOCAL manual, section 1 β and defncopy means extract procedures and views from a Microsoft server. π
β¨ iykyk.
β¨ SYNOPSIS β¨
defncopy [-v] [-U username] [-P password] [-S server] [-D database]
[-i input_file] [-o output_file] [owner.object_name
[owner.object_name ...]]
π¦ DESCRIPTION π¦
okay so defncopy is a utility program distributed with FreeTDS. It replaces a similar program of the same name distributed by Sybase β iconic succession moment, honestly. π«Ά
It 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. That's the whole glow-up: text in, recreate-ready script out. β¨
The owner part is optional if you or the database owner is the owner of the procedure/view being copied. The object_name is the name of the system object you wish to extract. yep, that's the assignment, periodt. π
π 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. (sad girlie hours π)-ooutput_file β a file to hold the script, defaults to standard output.-vβ Show version information and copyright notice.
π§ 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. lowkey filter behavior is the main character here. π
defncopy makes use of the db-lib API provided by FreeTDS. This API is of course also available to application developers. sharing is caring, bestie. π«Ά
β 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. dramatic? maybe. but it keeps going. π
π¦ HISTORY π¦
defncopy first appeared in FreeTDS 0.63. vintage-ish, but make it slay. β¨
π 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. that's the limit, bestie β extraction only, no cap. π
this page is from FreeTDS 1.5.20, dated April 26, 2012, and the footer energy is DEFNCOPY(FreeTDS) β byeee, go extract something cute! ππ
π¦ where this page comes from
- arch rolling: freetds 1.5.20-1 Β· GPL-2.0-only AND LGPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms