Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 search for a proc

Author  Topic 

gavakie
Posting Yak Master

221 Posts

Posted - 2010-04-12 : 11:10:18
Is there a way to search for a proc that populates a table?

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2010-04-12 : 11:13:35
found this, maybe it does what you want.
select specific_name from INFORMATION_SCHEMA.ROUTINES
where object_definition(object_id(specific_name)) like '%line%'


http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2010-04-12 : 11:13:46
If it doesn't do it in a block of dynamic sql you can use sp_depends.

Example:

EXEC sp_depends employee

Returns a list of all objects that reference the employee table.


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

Transact Charlie
Master Smack Fu Yak Hacker

3451 Posts

Posted - 2010-04-12 : 11:14:51
quote:
Originally posted by DonAtWork

found this, maybe it does what you want.
select specific_name from INFORMATION_SCHEMA.ROUTINES
where object_definition(object_id(specific_name)) like '%line%'



That looks pretty cool.


Charlie
===============================================================
Msg 3903, Level 16, State 1, Line 1736
The ROLLBACK TRANSACTION request has no corresponding BEGIN TRANSACTION
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-12 : 14:20:20
quote:
Originally posted by DonAtWork

found this, maybe it does what you want.
select specific_name from INFORMATION_SCHEMA.ROUTINES
where object_definition(object_id(specific_name)) like '%line%'


http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Any special reason why you used specific_name rather than routine_name column?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2010-04-13 : 02:56:37
quote:
Originally posted by visakh16

quote:
Originally posted by DonAtWork

found this, maybe it does what you want.
select specific_name from INFORMATION_SCHEMA.ROUTINES
where object_definition(object_id(specific_name)) like '%line%'


http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Any special reason why you used specific_name rather than routine_name column?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/




Note that SPECIFIC_NAME is same as ROUTINE_NAME.


Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-13 : 06:33:06
quote:
Originally posted by madhivanan

quote:
Originally posted by visakh16

quote:
Originally posted by DonAtWork

found this, maybe it does what you want.
select specific_name from INFORMATION_SCHEMA.ROUTINES
where object_definition(object_id(specific_name)) like '%line%'


http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Any special reason why you used specific_name rather than routine_name column?

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/




Note that SPECIFIC_NAME is same as ROUTINE_NAME.


Madhivanan

Failing to plan is Planning to fail


yup..That I know. I was curious on why he used specific_name as such

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2010-04-13 : 07:05:48
Because it is a snippet of code i stole borrowed from either you or madhi at some point in time.

Note i said i FOUND, not WROTE

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

visakh16
Very Important crosS Applying yaK Herder

52326 Posts

Posted - 2010-04-13 : 08:44:25
quote:
Originally posted by DonAtWork

Because it is a snippet of code i stole borrowed from either you or madhi at some point in time.

Note i said i FOUND, not WROTE

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp


Ok
I havent seen anybody using that column yet. Thats why I asked

------------------------------------------------------------------------------------------------------
SQL Server MVP
http://visakhm.blogspot.com/

Go to Top of Page

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2010-04-13 : 13:40:19
Ok, i think i pruned it from here with a small change:
http://www.sqlteam.com/forums/topic.asp?TOPIC_ID=82962

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page
   

- Advertisement -