我有一个名为DataSource的表,我试图找到所有包含'%txt'的列(这只是一个伪数据,我的实际数据库要复杂得多)
我尝试使用like
子句检查Parameter列是否具有txt
,它确实返回所有在子句中具有txt. But when I use
的行以获取列名,什么也不返回。任何帮助将不胜感激。我是从这篇帖子here中引用我的代码的。
Id Name Type Parameter FacilityColumn Progress EmailSent LastRunDate
1 EPIC-HB File C:/testdata.txt trans_rev_loc_id Complete 1 2019-04-25 04:15:00.0000000
2 EPIC-HB File C:/testdata.txt trans_rev_loc_id Complete 1 2019-04-25 04:15:00.0000000
3 EPIC-HB File C:/testdata.txt trans_rev_loc_id Complete 1 2019-04-25 04:15:00.0000000
4 EPIC-HB File C:/testdata.txt trans_rev_loc_id Complete 1 2019-04-25 04:15:00.0000000
5 EPIC-HB File C:/testdata.txt trans_rev_loc_id Complete 1 2019-04-25 04:15:00.0000000
6 EPIC-HB File C:/testdata.txt trans_rev_loc_id Complete 1 2019-04-25 04:15:00.0000000
select * from dbo.DataSource where '%txt' IN (select name from sys.columns where object_id =130099504);
select * from dbo.DataSource where Parameter like '%txt';