简书链接:sqlserver更多代码的搜索如存储过程,表值函数
文章字数:109,阅读全文大约需要1分钟

1
2
3
4
```o.type = 'IF':```选择对象类型为内联表值函数(Inline Table-Valued Function)。
```o.type = 'TF':```选择对象类型为多语句表值函数(Multi-Statement Table-Valued

搜索语句

SELECT o.name AS FunctionName, c.text AS FunctionDefinition
FROM sysobjects o
JOIN syscomments c ON o.id = c.id
WHERE (o.type = ‘FN’ OR o.type = ‘IF’ OR o.type = ‘TF’) – 这将返回所有函数
AND c.text LIKE ‘%your_search_term%’;



![image.png](https://upload-images.jianshu.io/upload_images/2815884-96b62de2428d4815.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)

上图可见可以搜索很多,存储过程代码也能搜到