Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Can anyone show me how to use de 1

Status
Not open for further replies.

dickiebird

Programmer
Feb 14, 2002
758
GB
Can anyone show me how to use defncopy
I want to extract the text of all my stored procedures, in a loop in a script.
Here's a sample of just trying to get the text from one sp
defncopy -Usduser -Psdpass out audit.sp_groupccy.P.ddl audit
So there's my 'out filename' and the database name (audit)
as per the manual, but I can't see how defncopy knows which sp to print.

Dickie Bird (:)-)))
 
Running the command with no parameters will show you the syntax.

Using the below example you can tell it which 'object' to print by specify it after the 'out <database>' piece of your command, So just add the <owner>.<object> ex: dbo.sp_youWanttoPrint to the end of your command.


$ defncopy
defncopy Syntax Error
Usage: defncopy
[-v]
[-X]
[-a <display_charset>]
[-I <interfaces_file>]
[-J [<client_charset>]]
[-K <keytab_file>]
[-P <password>]
[-R <remote_server_principal>]
[-S [<server_name>]]
[-U <user_name>]
[-V <security_options>]
[-Z <security_mechanism>]
[-z <language>]
{ in <file_name> <database_name> |
out <file_name> <database_name> [<owner>.]<object_name>
[[<owner>.]<object_name>...] }


-=-=-=-=-=-=-=-=-
For ease of reading, any posted CODE should be wrapped by [ignore][COLOR]
and
Code:
[/ignore] tags.

Ex:
Code:
SELECT 1 from sysobjects

 
Ahhh - Got it, thanks JeaNiBee - have a star !

Dickie Bird (:)-)))
 
Why thank you very much!!

Glad to be of help.




-=-=-=-=-=-=-=-=-
For ease of reading, any posted CODE should be wrapped by [ignore][COLOR][/COLOR] and
Code:
[/ignore] tags.

Ex:
Code:
SELECT 1 from sysobjects

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top