Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 update views

Author  Topic 

jung1975
Aged Yak Warrior

503 Posts

Posted - 2005-09-13 : 18:27:09
How can I update the code inside a view ,which there are about 4000 of them.
Basally, I have to change "where state in ( 'TN', 'CA' ) " to "where state in ('MA', 'DC' ) inside the view.

Is there any way I can do this dynamically?



tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2005-09-13 : 18:46:27
Script all of the views out to a file using Enterprise Manager's Generate SQL Script wizard. Then use the editor of your choice (notepad, TextPad, UltraEdit) to do a find and replace. Save the changes, then run this new script in a Query Analyzer window to update the database.

Tara
Go to Top of Page
   

- Advertisement -