Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Trace the links to a column in SQL (primary key)

Posted on 2011-09-21
5
Medium Priority
?
172 Views
Last Modified: 2012-05-12
I wish to trace a link for a column (primary key) to see what other tables will be referencing it.

The reason for this is:
I have a problem with the way I entered the data into my sql DB.
I simply copy and pasted the data, which works fine until I insert a new data row through the software front end (Access Dimension) which crashes with a primary key dublication issue.
The old PK where pasted in and now when I get to an insert PK of 2 (the 2nd) it fails.

Alternatively a way to reset the PK value would suffice but the most common ways do not work as the field is a float.

any advise is very appriciated
0
Comment
Question by:dexterhome
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 9

Accepted Solution

by:
mimran18 earned 750 total points
ID: 36573592
Goto SSMS.
Select the table and right click on it
and select the view dependencies.
0
 
LVL 5

Author Comment

by:dexterhome
ID: 36574016
Thanks for that mimran18.

This appears to show me the dependencies for the stock table which is a lot.
Can it be narrowed down to the column in any way?
0
 
LVL 9

Expert Comment

by:mimran18
ID: 36575758
0
 
LVL 11

Assisted Solution

by:Simone B
Simone B earned 750 total points
ID: 36575830
If the name of the key is consistent, eg the primary key for employee always appears as EmployeeID, then you should be able to find all related tables using the Information_Schema views.

Eg:

Use MyDatabase
go

Select * from INFORMATION_SCHEMA.COLUMNS
where COLUMN_NAME = 'EmployeeID'
0
 
LVL 5

Author Closing Comment

by:dexterhome
ID: 36933406
thanks guys
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

When trying to connect from SSMS v17.x to a SQL Server Integration Services 2016 instance or previous version, you get the error “Connecting to the Integration Services service on the computer failed with the following error: 'The specified service …
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Via a live example, show how to set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Viewers will learn how the fundamental information of how to create a table.

610 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question