Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

Chris O'Sullivan http://www.thechrisoshow.com

« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS 

Ruby on Rails: Change class name into human readable string

This turns a class name (like LineItem) into a nice string (like "line item")

 line_item = LineItem.new
 puts line_item.class.name.underscore.humanize.lowcase #spits out "line item"

SQL Server: Search through stored procedures for code

This returns the names of stored procedures that contain the text you're looking for.

select so.name as 'storProc'
from sysobjects so
join syscomments sc
on so.id=sc.id
where so.type='P'
and sc.[text] like '%BIT_YOU_WANT_TO_FIND%' 


Say for example you're looking for all the stored procedures that mentioned the table 'user_table' - then just use this script and the all the stored procedures that make mention of this will be returned.
« Newer Snippets
Older Snippets »
Showing 1-2 of 2 total  RSS