This blog is about my history as a software engineer utilizing technologies C#, Java, React, JavaScript, .NET Core, SQL Server , Oracle, GIT, GitHub, Jira, Azure, AWS and HTML5. “I have not failed. I've just found 10,000 ways that won't work.” Thomas A. Edison. Please click on all my ADVERTISING links to help support this blog. Thank you.
Friday, February 15, 2013
Search for Text in SQL Server DB
use DB_NAME
SELECT DISTINCT
DB_NAME() AS DatabaseName,
OBJECT_SCHEMA_NAME(id) AS SchemaName,
OBJECT_NAME(id) AS ObjectName,
SUBSTRING(text, PATINDEX('%YOUR_SEARCH_TEXT%',text) - 10, 100) AS TextLocation
FROM sys.syscomments
WHERE text LIKE '%YOUR_SEARCH_TEXT%'
ORDER BY 1, 2, 3
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment