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.
| Author |
Topic |
|
lopes_andre
Starting Member
12 Posts |
Posted - 2009-12-03 : 14:51:58
|
| Hi,I have a database with 400 views, and I need to search for a view containing the text "table1".How can I search for "table1" in 400 views?Best Regards, |
|
|
Vinnie881
Master Smack Fu Yak Hacker
1231 Posts |
Posted - 2009-12-03 : 15:02:10
|
select Table_Name from INFORMATION_SCHEMA.Views awhere View_Definition like '%Table1%' Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881 |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-12-04 : 03:02:43
|
quote: Originally posted by Vinnie881 select Table_Name from INFORMATION_SCHEMA.Views awhere View_Definition like '%Table1%' Success is 10% Intelligence, 70% Determination, and 22% Stupidity.\_/ _/ _/\_/ _/\_/ _/ _/- 881
Beware of 4000 charaters limitThe proper way is1 Generate script of Views to files and do searchex http://sqlblogcasts.com/blogs/madhivanan/archive/2007/12/13/script-out-procedures-and-functions-part-2.aspx2 Make use this scriptselect name from sys.sysobjectswhere type='v' and object_definition(object_id(name)) like '%table1%'MadhivananFailing to plan is Planning to fail |
 |
|
|
lopes_andre
Starting Member
12 Posts |
Posted - 2009-12-04 : 13:28:28
|
| Thanks, it worked! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2009-12-07 : 02:06:49
|
quote: Originally posted by lopes_andre Thanks, it worked!
Which worked? MadhivananFailing to plan is Planning to fail |
 |
|
|
|
|
|