0

I am working on an old piece of Software using a SQL Server database (let's call it DB A) with loads of interconnections to other DB. One of this other other DB (DB B) will be removed soon and I have two functions in my DB A who access this DB.

So I would like to know how and where I can get the info whether these functions are still in use. And if yes, who/what uses it ?

Thx in advance for the help.

  • You can use SQLSearch from RedGate to find references to the function on the sql side. If you have applications that are building their own ad hoc sql you will have to search the source code. Yet another argument to use stored procedures for everything. IF those functions do some sort of identifiable data modification you could search for those but I suspect you aren't that lucky. – Sean Lange Aug 10 '15 at 15:15
  • possible duplicate of [Check if SQL object is referenced by any other SQL objects](http://stackoverflow.com/questions/26338933/check-if-sql-object-is-referenced-by-any-other-sql-objects) – mwigdahl Aug 10 '15 at 15:19

2 Answers2

0

I do not think this is possible for functions. I know it is for stored procedures but not functions

Coding Duchess
  • 6,445
  • 20
  • 113
  • 209
0

If you're using the functions from stored procedures, other functions, views etc., you should be able to find them from sys.sql_modules. If it's in your C# etc. code, then you'll probably have to look into your version control.

James Z
  • 12,209
  • 10
  • 24
  • 44