Linked Questions

1 vote
1 answer
561 views

I have one Employee table in my Database which has relations to different other tables. In my application, When a user try to delete one employee which has relational data in other tables, I want to ...
Yesudass Moses's user avatar
1 vote
0 answers
211 views

Possible Duplicate: How can I list all foreign keys referencing a given table in SQL Server 2005? I'm trying to use Information_Schema to find all the FKs referencing a particular table. However ...
Liath's user avatar
  • 10.2k
-2 votes
1 answer
107 views

Apart from database architecture diagram, is there any way to get the list of all the tables with PK/FK relations?
NewbieCoder's user avatar
0 votes
1 answer
77 views

I would like to know the detail about my foreign keys. I tried this SELECT * FROM sys.foreign_keys; But I need more than the information I can get now. Is there a way to know the columns they are ...
Black cowgirl's user avatar
815 votes
16 answers
718k views

In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as this Oracle question, but for MySQL.
Christian Oudard's user avatar
500 votes
20 answers
784k views

I have a stored procedure that returns 80 columns, and 300 rows. I want to write a select that gets 2 of those columns. Something like SELECT col1, col2 FROM EXEC MyStoredProc 'param1', 'param2' ...
Rossini's user avatar
  • 6,048
414 votes
11 answers
669k views

How to remove a column from an existing table? I have a table MEN with Fname and Lname I need to remove the Lname How to do it?
Gali's user avatar
  • 15k
215 votes
17 answers
508k views

I am trying to drop a table but getting the following message: Msg 3726, Level 16, State 1, Line 3 Could not drop object 'dbo.UserProfile' because it is referenced by a FOREIGN KEY constraint. ...
user avatar
173 votes
13 answers
207k views

How can I find all of the foreign key dependencies on a particular column? What are the different alternatives (graphically in SSMS, queries/views in SQL Server, 3rd party database tools, code in ....
Even Mien's user avatar
  • 46.2k
25 votes
7 answers
112k views

Even though I am removing and trying to drop table, I get error, ALTER TABLE [dbo].[Table1] DROP CONSTRAINT [FK_Table1_Table2] GO DROP TABLE [dbo].[Table1] GO Error Msg 3726, Level 16, State 1, ...
Mathematics's user avatar
  • 7,688
43 votes
1 answer
45k views

Part-time reluctant DBA here. I want to change an existing primary key index from clustered to non-clustered. And the syntax is escaping me. This is how it's scripted out right now. ALTER TABLE [...
AngryHacker's user avatar
  • 62.1k
6 votes
3 answers
41k views

I want to find all foreign keys in my database that reference to a primary key of a certain table. For example, I have a column A in table T which is the primary key. Now I want to find in which ...
Hamid Talebi's user avatar
  • 1,338
2 votes
2 answers
9k views

I have a local db which has FOREIGN KEY constraints. The live version of this websites DB, does not have any of these FOREIGN KEY constraints. How can I "copy/paste", import/export ONLY the FOREIGN ...
Shmarman's user avatar
1 vote
4 answers
16k views

In StackOverflow, I can find the post about how to find all foreign key constraints in SQL Server. I only can find the post about how to find all foreign key constraints for a table in Oralce (List ...
FullStackDeveloper's user avatar
5 votes
4 answers
6k views

I have table A with a primary key on column ID and tables B,C,D... that have 1 or more columns with foreign key relationships to A.ID. How do I write a query that shows me all tables that contain a ...
CoderBrien's user avatar

15 30 50 per page