Skip to content

Bits of .NET

Daily micro-tips for C#, SQL, performance, and scalable backend engineering.

  • Asp.Net Core
  • C#
  • SQL
  • JavaScript
  • CSS
  • About
  • ErcanOPAK.com
SQL

List all Foreign Keys referencing a given table in SQL Server

- 20.11.19 | 27.11.19 - ErcanOPAK
EXEC sp_fkeys 'TableName'

You can also specify the schema:

EXEC sp_fkeys @pktable_name = 'TableName', @pktable_owner = 'dbo'

Related posts:

How to Alter a Computed Column in SQL?

Create, Alter, Drop and Execute SQL Server Stored Procedures

How to reset identity seed after deleting records in SQL

Change Default Value for "Select Top n" and "Edit Top n" Rows in SQL Server Studio

Post Views: 99

Post navigation

@helpers in Asp.NET MVC Razor
ASPxGridView – Disable CheckBox based on condition in GridViewCommandColumn

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

December 2025
M T W T F S S
1234567
891011121314
15161718192021
22232425262728
293031  
« Nov    

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (915)
  • Get the First and Last Word from a String or Sentence in SQL (798)
  • How to select distinct rows in a datatable in C# (772)
  • How to add default value for Entity Framework migrations for DateTime and Bool (772)
  • How to make theater mode the default for Youtube (586)
  • Add Constraint to SQL Table to ensure email contains @ (558)
  • How to enable, disable and check if Service Broker is enabled on a database in SQL Server (531)
  • Average of all values in a column that are not zero in SQL (505)
  • Find numbers with more than two decimal places in SQL (421)
  • How to use Map Mode for Vertical Scroll Mode in Visual Studio (416)

Recent Posts

  • VS “Debugger Attached But Breakpoints Skip” — The Optimization Trap
  • WP “Permalinks Not Working” — The .htaccess Rewrite Reset
  • Windows 11 “VPN Slow After Update” — Broken MTU
  • Windows 11 “Alt-Tab Lag” — The Explorer Restart Trick
  • AJAX “POST Suddenly Fails” — The Missing Content-Type Header
  • JS “Undefined Errors in Loops” — The Closure Trap
  • HTML5 Input “step=any” — The Secret to Fix Broken Decimal Validation
  • CSS “Absolute Element Misaligned” — The position: relative Curse
  • .NET Core “Kestrel Timeout” — The Hidden Request Body Limit
  • ASP.NET Core “IOptions Snapshot Turns Slow” — The Startup Misuse

Most Viewed Posts

  • Get the User Name and Domain Name from an Email Address in SQL (915)
  • Get the First and Last Word from a String or Sentence in SQL (798)
  • How to select distinct rows in a datatable in C# (772)
  • How to add default value for Entity Framework migrations for DateTime and Bool (772)
  • How to make theater mode the default for Youtube (586)

Recent Posts

  • VS “Debugger Attached But Breakpoints Skip” — The Optimization Trap
  • WP “Permalinks Not Working” — The .htaccess Rewrite Reset
  • Windows 11 “VPN Slow After Update” — Broken MTU
  • Windows 11 “Alt-Tab Lag” — The Explorer Restart Trick
  • AJAX “POST Suddenly Fails” — The Missing Content-Type Header

Social

  • ErcanOPAK.com
  • GoodReads
  • LetterBoxD
  • Linkedin
  • The Blog
  • Twitter
© 2025 Bits of .NET | Built with Xblog Plus free WordPress theme by wpthemespace.com