• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1151
  • Last Modified:

Search All Tables in DB for GUID

I found one SP that will search for strings but not GUIDs. Does anybody have a SP or query that can do this?

Thanks.
0
LCNW
Asked:
LCNW
  • 4
2 Solutions
 
p_nutsCommented:
What do you mean with guid
0
 
LCNWAuthor Commented:
unique identifier, such as ee549e9c-60d1-4b7f-a6f1-b88c45960248
0
 
LCNWAuthor Commented:
I found this but am unsure how to run it. I created the SP but not sure what to do next.

http://stackoverflow.com/questions/970477/sql-server-search-all-tables-for-a-particular-guid
0
 
LCNWAuthor Commented:
I figured out to tweak this code:

http://vyaskn.tripod.com/search_all_columns_in_all_tables.htm

to include 'uniqueidentifier'

So from
AND      DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar')
to
AND      DATA_TYPE IN ('char', 'varchar', 'nchar', 'nvarchar','uniqueidentifier')

This works great.
0
 
LCNWAuthor Commented:
I found this on my own.
0

Featured Post

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

  • 4
Tackle projects and never again get stuck behind a technical roadblock.
Join Now