October 14, 2009 at 7:54 am
Pls Help ....
Script to List the Database Objects With Specific Keyword
October 14, 2009 at 7:58 am
all objects are in the system view sys.objects
so you'd simply do SELECT * FROM sys.objects where name like'%BIZ%' for example.
Lowell
October 14, 2009 at 8:03 am
And if you don't specifically need this to be a script, just hit F4 in your query analyzer to do an object search. If I didn't need my F4 button for other apps, I'd have ripped that key off years ago and left it sitting in the drawer next to my insert key.
October 14, 2009 at 8:03 am
Thanks ..
If you don't mind .. Can you tell me
Script to List of the Objects that uses a Specific Column name
October 14, 2009 at 8:11 am
I can use this .. Right
But the Problems is .. Gives Error in 2000
SELECT Name, create_date,modify_date
FROM sys.procedures
WHERE OBJECT_DEFINITION(object_id) LIKE '%CDRMaster%'
AND OBJECT_DEFINITION(object_id) LIKE '%CDRID%'
October 14, 2009 at 8:12 am
John Paul-702936 (10/14/2009)
Thanks ..If you don't mind .. Can you tell me
Script to List of the Objects that uses a Specific Column name
aain, you'd use one of the system views, thistime sys.columns
SELECT OBJECT_NAME(object_id) AS TableName ,name as ColumnName from sys.columns where name='ORDERID'
Lowell
October 14, 2009 at 8:15 am
Does n't works in 2000...
What is equivalent to OBJECT_name in 2000
October 14, 2009 at 8:23 am
you posted in a SQL 2005 forum, so you got 2005-specific examples.
it's not object_name that is stopping your script...it's sys.columns:
SELECT OBJECT_NAME(id) from syscolumns where name ='ORDERID'
will work in 2000
Lowell
October 14, 2009 at 8:36 am
It gives the table list which uses the Specific Column ..
But , It's not Listed any storeprocedures or Function or Views ..
Is anything else we need to add ... to get alist of SP,Fun,Vw
October 14, 2009 at 8:59 am
I guess you are looking for this?
Select * from sysobjects
Where id in (Select id from
syscomments Where text like '%urcolumn%')
not sure if it works on 2000 as i dont use it, know it and i cant check it! 🙂
---------------------------------------------------------------------------------
October 14, 2009 at 9:52 am
So you're basically looking for column level dependencies. In 2000, I don't think you're going to find anything. Someone might have a script that'd get you closer than this, but this will get you started:
SELECT TOP 500 o.name, c.*
FROM syscomments c
INNER JOIN sysobjects o ON c.id = o.id
WHERE c.text LIKE '% SCP %'
October 14, 2009 at 9:53 am
October 14, 2009 at 10:21 am
Thanks for Script ..
I am very sorry to Bug you again and agian .. Actually I don't have Clear idea what i need Extractly ..
Please Can You tell like
How to find dependencies of a Varibale
Like I have varibale ' @a '.. Is there any Script to get the list of the Objects that are using Specific varibale '@A'
I tried to use the Previous Script .. But it gives all the Objects which uses varibales like .. ' @AA ' , @art.. Because of the ' % ' we are using ... If i excute Without ' %'.. no objects are displyed ...
Can you help me out pls :
GET THE LIST OF OBJECTS WHICH USES SPECIFIC @VARIBALE ?
October 14, 2009 at 10:23 am
October 14, 2009 at 10:30 am
Thanks
Viewing 15 posts - 1 through 14 (of 14 total)
You must be logged in to reply to this topic. Login to reply