方法一,是我自己经常用到的:

 

'

 

方法二:

刚在外文资料上看到的:

 


Select Specific_Catalog as Database_Name, Routine_Name as ''Stored Procedure Name'',Routine_Definition 
From 
'+ @getdbname+'.Information_Schema.Routines 
Where PatIndex(
'+''''+@SString+''''+', Routine_Definition) > 0'

--Execute the Query
EXEC (@sqlstm)
FETCH NEXT FROM dbname into @getdbname
END

--Close the Cursor and Deallocate it from memory
Close dbname
Deallocate dbname 

 

 

(出处:http://www.sqlservercentral.com/scripts/Search/63397/

 

第二个用的cursor查找,所有库的,二者范围不一样。

供大家急需时参考。

相关文章:

  • 2022-12-23
  • 2021-08-07
  • 2022-12-23
  • 2021-09-11
  • 2022-12-23
  • 2021-10-16
猜你喜欢
  • 2021-12-10
  • 2021-12-12
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2021-12-12
相关资源
相似解决方案