Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase ««12

Quering Code Expand / Collapse
Author
Message
Posted Monday, May 13, 2013 5:34 PM


SSCertifiable

SSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiableSSCertifiable

Group: General Forum Members
Last Login: Thursday, April 17, 2014 3:16 PM
Points: 5,986, Visits: 6,931
ScottPletcher (5/13/2013)
I also search table sys.sql_modules, which contains the code for all sys.objects members of type P, RF, V, TR, FN, IF, TF, and R.

If you want to check for use in a job step, also check table sysjobsteps (msdb.dbo.sysjobsteps), column "command".


+1, except for the job part. I use this constantly, particularly when I'm trapsing around in other architectures trying to figure out what the... errr... /rant. sys.sql_modules, what did I ever do without you?... oh, right, play games in syscomments trying to concatonate the mess.



- Craig Farrell

Never stop learning, even if it hurts. Ego bruises are practically mandatory as you learn unless you've never risked enough to make a mistake.

For better assistance in answering your questions | Forum Netiquette
For index/tuning help, follow these directions. |Tally Tables

Twitter: @AnyWayDBA
Post #1452367
Posted Monday, May 13, 2013 7:31 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 35,967, Visits: 30,258
Sean Lange (5/13/2013)
Eugene Elutin (5/13/2013)
Install RedGate DB search - it's free!

http://www.red-gate.com/products/sql-development/sql-search/


+1

Once you install it you will ask yourself how you ever managed to find anything without it. I use it daily.


Ya just gotta like Microsoft. Such functionality used to be available in SQL Server 2000 by pressing the {f4} key. It was a great, fully documented feature and they simply took it away with the release of SQL Server 2005. I'd love to meet the person that made that decision... there would certainly be a load of high velocity porkchops in that meeting.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1452375
Posted Monday, May 13, 2013 7:38 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 35,967, Visits: 30,258
I do the same thing as what Scott identified above. I use sys.sql_modules and other system tables to help me on such tasks. Just be aware that comments will frequently give false returns when searching for common names like "Client" or "User(s)" or "Employee(s)", etc.

Heh... but, not to worry. According to a lot of the code I've seen, comments won't interfere because (unfortunately) so few people actually use them.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1452376
Posted Monday, May 13, 2013 7:41 PM


SSC-Dedicated

SSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-DedicatedSSC-Dedicated

Group: General Forum Members
Last Login: Yesterday @ 4:00 PM
Points: 35,967, Visits: 30,258
dwilliscp (5/13/2013)
I do not have permissions on the server.. and there is a lot of red tape to get anything installed.

However I did use the SQL provided... with a few changes... thanks for everyones help.

; with base as
(
SELECT DISTINCT o.name as Calling_Name
, o.type_desc as Calling_desc
, p.name as Called_Name
, p.type_desc as Called_Desc
FROM sys.sql_dependencies d
INNER JOIN sys.objects o
ON d.object_id = o.object_id
INNER JOIN sys.objects p
ON d.referenced_major_id = p.object_id
)
select * from base
where [called_name] like 'zt_MSC%'
order by called_name, Calling_name


You could be missing out on quite a bit. Since stored procedures can be built before the objects they work with are built, you could have a whole lot of stored procedures where the dependencies were never updated.


--Jeff Moden
"RBAR is pronounced "ree-bar" and is a "Modenism" for "Row-By-Agonizing-Row".

First step towards the paradigm shift of writing Set Based code:
Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column."

"Change is inevitable. Change for the better is not." -- 04 August 2013
(play on words) "Just because you CAN do something in T-SQL, doesn't mean you SHOULDN'T." --22 Aug 2013

Helpful Links:
How to post code problems
How to post performance problems
Post #1452377
Posted Tuesday, May 14, 2013 9:59 AM
SSC Veteran

SSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC VeteranSSC Veteran

Group: General Forum Members
Last Login: Wednesday, April 16, 2014 11:21 AM
Points: 293, Visits: 499
Thanks for the warning Jeff.

On the Jobs front.. We almost never put SQL into the Job, but thanks for reminding me to check there too. Thanks to everyone for your help in building a SQL statment. Oh, and I do not have access on my PC to install ... but I put in a request to get the Redgate plug-in installed on my PC.

Post #1452693
Posted Tuesday, May 14, 2013 11:01 AM
SSCommitted

SSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommittedSSCommitted

Group: General Forum Members
Last Login: 2 days ago @ 4:53 PM
Points: 1,746, Visits: 2,553
dwilliscp (5/14/2013)
Thanks for the warning Jeff.

On the Jobs front.. We almost never put SQL into the Job, but thanks for reminding me to check there too. Thanks to everyone for your help in building a SQL statment. Oh, and I do not have access on my PC to install ... but I put in a request to get the Redgate plug-in installed on my PC.



You're welcome about the reminder for jobs.


SQL DBA,SQL Server MVP('07, '08, '09)
I'm not fat, I'm gravity challenged.
Post #1452726
« Prev Topic | Next Topic »

Add to briefcase ««12

Permissions Expand / Collapse