June 16, 2021 at 2:42 pm
Hi,
I have a field in a table called prin_ball, upon doing a search for this, I would have to change it in about 158 different objects (that is jobs tables, procedures, views, and triggers). Is there anyway of doing a find and replace to change all at once. Or at least the views, tables and procedures?
Thank you
June 16, 2021 at 5:15 pm
As far as I know, this is a manual process. If you NEED to change the table but don't want to change all of the objects using that table, you could create a view with that name and have it select from the new table name. This way existing objects won't break and your table will have the new name.
If that isn't an option, you will need to adjust all objects that are calling that table when you rename it. You can script it and have it in a single transaction so on the back end, everything is "changed" at the same time. But there is no automated way that I am aware of.
The above is all just my opinion on what you should do.
As with all advice you find on a random internet forum - you shouldn't blindly follow it. Always test on a test server to see if there is negative side effects before making changes to live!
I recommend you NEVER run "random code" you found online on any system you care about UNLESS you understand and can verify the code OR you don't care if the code trashes your system.
June 16, 2021 at 6:01 pm
Hi,
Oaky thanks.
June 16, 2021 at 6:06 pm
What is the change that needs to be made? Normally - adding a column to a table shouldn't require changing any other code and shouldn't require modifying the view. If you are removing or renaming a column then I would recommend looking at the change in more detail.
Jeffrey Williams
“We are all faced with a series of great opportunities brilliantly disguised as impossible situations.”
― Charles R. Swindoll
How to post questions to get better answers faster
Managing Transaction Logs
Viewing 4 posts - 1 through 3 (of 3 total)
You must be logged in to reply to this topic. Login to reply