Can this be done?
Does anyone know of a tool or command I could use that can find all occurrences of a particular string?
I want to look in all of my procs and triggers.
For example, I have an event_code column on some tables. I reference that column in my procs and triggers. In my scripts, I may have something like @event_code = 'DDENT'. I want to search through all procs and triggers for 'DDENT'.
I have all of my procs & triggers in .sql files and I could search using windows explorer for the DDENT string but I don't trust the results.
"You can script all database objects into one file." How do I do this?
What is MMC plugin for 7/2000 and how/where can I get it?
This will return the object names that contain the string "DDENT".
Hope that helps,
That worked great - thanks!
You can do this entirely in T-SQL by concatenating the [text] field into a seperate table that has a field with a text datatype (thus allowing more than 8000 characters). You can then safely perform a like comparison.
It's a bit awkward though and given how remote the chances of this occurring are, unless it's an essential part of an app you're building, you might as well just script the procs and do a Find/Replace search. Or accept the risk.