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 |
|
pug2694328
Posting Yak Master
166 Posts |
Posted - 2006-02-02 : 12:24:07
|
| What query would return a list of table names that match a mask?Example: Get all tables with OPT in the name.SELECT *FROM ?WHERE NAME LIKE '%OPT%' |
|
|
nr
SQLTeam MVY
12543 Posts |
Posted - 2006-02-02 : 12:25:37
|
| SELECT*FROMsysobjectsWHERENAME LIKE '%OPT%'and xtype = 'U'also see information_schema.tables==========================================Cursors are useful if you don't know sql.DTS can be used in a similar way.Beer is not cold and it isn't fizzy. |
 |
|
|
pug2694328
Posting Yak Master
166 Posts |
Posted - 2006-02-02 : 13:50:12
|
| Beautiful, Thanks! |
 |
|
|
madhivanan
Premature Yak Congratulator
22864 Posts |
Posted - 2006-02-03 : 03:25:53
|
| AlsoSelect table_name from Information_Schema.tables where table_name like '%OPT%'MadhivananFailing to plan is Planning to fail |
 |
|
|
pug2694328
Posting Yak Master
166 Posts |
Posted - 2006-02-03 : 09:30:52
|
| thanks madhivanan, two ways are better than one, and this one is slightly more efficient :) |
 |
|
|
|
|
|