📜  使用文本在数据库中搜索 - SQL 代码示例

📅  最后修改于: 2022-03-11 15:05:23.729000             🧑  作者: Mango

代码示例1
declare @SearchText nvarchar(max)='searchText'
SELECT  o.[name] as object_name
                                                            , sm.[definition]
                                                    FROM sys.sql_modules AS sm
                                                    JOIN sys.objects AS o
                                                        ON sm.object_id = o.object_id
                                                    JOIN sys.schemas AS ss
                                                        ON o.schema_id = ss.schema_id
where sm.[definition] like '%'+@SearchText+'%'