Prasanna,
I used this script to get information about Functions and Updated/Selected columns. I hope this willl atleast give you an idea about it.
You can also set an auditing trigger for DDL statements that will provide you in depth on what DDL ran on which column or table in database.
Please read the below blog:
http://www.sqlservercentral.com/articles/DDL+Event/70657/
They have scripts in a .Zip file. I have not used that yet but I guess this will provide you more programming knowledge on how to set those auditing triggers.
Create table #USP_Dependents
(Usp_name varchar(300),
Dependent_name varchar(300),
type varchar(50),
updated varchar(50),
selected varchar(50),
[column]varchar(50)
)
Create table #USP_Dep
(Dependent_name varchar(300),
type varchar(50),
updated varchar(50),
selected varchar(50),
[column]varchar(50)
)
declare @name varchar(500)
declare cur_depend Cursor for
Select distinct name from sysobjects
where xtype = 'FN'
and name like 'IS%'
open cur_depend
fetch next from cur_depend into @name
while @@FETCH_STATUS = 0
begin
INSERT INTO #USP_Dep EXEC sp_depends @name
INSERT INTO #USP_Dependents(Usp_name,Dependent_name,type,updated,selected,[column])
select @name,Dependent_name,type,updated,selected,[column]
from #USP_dep
delete from #USP_Dep
fetch next from cur_depend into @name
end
close cur_depend
deallocate cur_depend
Select * from #USP_Dependents