Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

SQL 2005 Information.Schema views question 1

Status
Not open for further replies.

Catadmin

Programmer
Oct 26, 2001
3,097
US
All,

Okay, looking at the I.S. views, I see one that tells me if a column is used in a Constraint, one that tells me if it's used in a Key, one that tells me if it's used in a Function and one that tells me if the column is used in a View.

What I don't see is an I.S. view that tells me if a column is used in a Stored Procedure or a Trigger. Do you know of any that do those in 2005? It doesn't look like the Constraints one does the Triggers, which I was hoping.

Thanks,


Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
If you know the column name I have this query that will tell you if it's used in a procedure.

select *
from INFORMATION_SCHEMA.ROUTINES
where ROUTINE_TYPE='PROCEDURE'
AND SPECIFIC_NAME like 'usp%' --procedure name
AND ROUTINE_DEFINITION like '%CLAIM_COUNT%' --column name

- Paul
- Database performance looks fine, it must be the Network!
 
Aha! I didn't even think of using the ROUTINES one. I was looking at all the ones listing COLUMN in the name of the view.

Thanks, Paul! Star for you. @=)



Catadmin - MCDBA, MCSA
"No, no. Yes. No, I tried that. Yes, both ways. No, I don't know. No again. Are there any more questions?"
-- Xena, "Been There, Done That"
 
Anytime cat. With the number of times you've helped me it's the least I could do.


- Paul
- Database performance looks fine, it must be the Network!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top