Results 1 to 3 of 3
  1. #1
    Join Date
    Oct 2003
    Posts
    81

    Unanswered: Script to Add 'WITH ENCRYPTION' to all SP's, V's and Fn's

    I'm about to roll out a new database to another site and would like to encrypt all stored procedures, views and functions. I know this can be done by simply adding WITH ENCRYPTION in the appropriate spot, but I don't want to edit every single stored procedure, view and function one by one.

    Is there a way (and if so, how do I go about it) to first of all output all stored procedures, views and scripts to a file, (not using enterprise manager, but rather using a sql script) then encrypt them all?

    Essentially, I need to output them all to a file first just in case I have to edit them again.

    Any ideas on how I would go about this?

    Thanks in advance

  2. #2
    Join Date
    Oct 2003
    Posts
    81

    Question

    Anyone have any clues?

  3. #3
    Join Date
    May 2002
    Posts
    299
    you need to script out the sp/fn/etc, then use FileSystemObject to read the file in and look for " AS" and prefix it with "with encryption". There isn't any *automated* way or sql builtin tool.
    --
    -oj
    http://www.rac4sql.net

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •