• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 231
  • Last Modified:

insert fucntion to trigger

I need to modify all my triggers wiht the following criteria inserting the
follwoing  fucntion :
   
vFunction = "dbo.f_ch_to_x"

Using criteria.

        select * from INFORMATION_SCHEMA.COLUMNS  
                  "where is_Nullable = 'YES'
                  "and Data_Type = 'char'
                  "and Table_Name Like 'vPER_%'
                  "order by column_name "

What will be the best way to do that.

0
bolicat
Asked:
bolicat
  • 3
  • 2
1 Solution
 
JesterTooCommented:
I'd suggest exporting all the trigger scripts out to a text file (with the drop/create syntax) then running the resulting file through any scriptable editor that you may be familiar with to insert the statement in the appropriate locations.  FInally, AFTER THROUGH REVIEW, run the resulting edited file back into SQL Server via Query Analyzer.  Be certain to keep a copy of the original script file before the edits are performed just in case something messes up.

HTH,
Lynn
0
 
JesterTooCommented:
I forgot to mention that SQL Server doesn't let you export scripts for just the triggers by themselves... if you use EM to do this you have to select all the tables... the triggers will come along for the ride.

There is a downloadable app that will allow you to export just the triggers... see the following link (you have to "register" with the site to get to the article, but it's free and painless... just use your email address and any password you like).

   http://www.ftponline.com/vsm/2002_09_14th/magazine/features/rehak/default_pf.aspx
0
 
bolicatAuthor Commented:
I will going to try to download the EM keep you posted.

Thanks
0
 
bolicatAuthor Commented:
I finally got my registration from the link suggested, what is the applicant name?
0
 
JesterTooCommented:
I believe the comments I provided earlier are the easiest solution to this question since there is no tool available to make the desired modifications directly to the sprocs "en masse".

0

Featured Post

[Webinar] Database Backup and Recovery

Does your company store data on premises, off site, in the cloud, or a combination of these? If you answered “yes”, you need a data backup recovery plan that fits each and every platform. Watch now as as Percona teaches us how to build agile data backup recovery plan.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now