February 26, 2015 at 10:54 am
Hi,
I found a few 'SearchAllTables' scripts out there to help me find a value in any table/column/row of any Database.
My problem is that none of these database search queries seem to look at primary key values.
The value I'm looking for is a primary key - I need to find all the other tables that have this primary key value.
Anybody know how I could accomplish this?
February 26, 2015 at 12:26 pm
krypto69 (2/26/2015)
Hi,I found a few 'SearchAllTables' scripts out there to help me find a value in any table/column/row of any Database.
My problem is that none of these database search queries seem to look at primary key values.
The value I'm looking for is a primary key - I need to find all the other tables that have this primary key value.
Anybody know how I could accomplish this?
Do you mean primary key data or primary key name?
Can you give an example of what you mean?
February 26, 2015 at 12:30 pm
krypto69 (2/26/2015)
Hi,I found a few 'SearchAllTables' scripts out there to help me find a value in any table/column/row of any Database.
My problem is that none of these database search queries seem to look at primary key values.
The value I'm looking for is a primary key - I need to find all the other tables that have this primary key value.
Anybody know how I could accomplish this?
change the datatype of your script to search all tables to match the datatype expected(ie int?);
then you can search all tables for a column with the integer value of 98949;
you might want to also modify the script so that it joins on sys.indexes where idnexid = 1 and sys.index_columnsas well;
then you get only PK values.
it depends on your schema, obviously.
Lowell
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply