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!

DEFNCOPY and wrapper's

Status
Not open for further replies.

davism

MIS
Nov 9, 2002
140
US
The database has SP's that include header with the IF EXISTS and the footer of the security aspects. My question is - is it possible to use DEFNCOPY to output the contents of the SP to a file but have that file contain those header and footer wrappers?

Please let me know.

Your assistance would be greatly appreciated! :)
 
I believe since defncopy doesn't retain header and footer you would have to do it yourself.I achieved the same using shell scripts.This is a sample code

echo "If exists(select 1 from sysobjects where name = \"$file\" and type = \"TR\")" >> "filename"
echo "drop trigger dbo." $file >> "filename"
echo "go" >> "filename"
defncopy your stuff
echo "grant execute on " etc etc and so on..

Hope this helps.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top