{"id":205,"date":"2016-04-15T14:28:23","date_gmt":"2016-04-15T19:28:23","guid":{"rendered":"http:\/\/www.sqlnuggets.com\/?p=205"},"modified":"2016-04-15T14:30:51","modified_gmt":"2016-04-15T19:30:51","slug":"list-foreign-keys-referencing-table-sql-server","status":"publish","type":"post","link":"https:\/\/sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/","title":{"rendered":"List All Foreign Keys Referencing A Table In SQL Server"},"content":{"rendered":"<p>There may be times that you need to get\u00a0a list of\u00a0tables that have foreign key constraints back to a table that you&#8217;re working on. \u00a0Fortunately, SQL Server has a built in system procedure that makes this extremely simple. \u00a0Let me introduce you to\u00a0<em><a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ms175090.aspx\" target=\"_blank\">sp_fkeys<\/a><\/em>. \u00a0This sweet\u00a0little proc returns information about\u00a0foreign key relationships based off of the parameters passed to it.<\/p>\n<p>Getting started with\u00a0<em>sp_fkeys<\/em> couldn&#8217;t be simpler, just specify the table name you want to look up the foreign keys for! \u00a0So, for example, if you wanted to look up all of the tables within your database that have foreign keys back to a\u00a0<em>users<\/em>\u00a0table, you would use the following:<\/p>\n<pre class=\"lang:tsql decode:true\">EXEC sp_fkeys 'users'<\/pre>\n<p>Pretty simple, right? \u00a0You can also pass in other parameters besides the table name, see the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/ms175090.aspx\" target=\"_blank\">MSDN doc<\/a> for the full list.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There may be times that you need to get\u00a0a list of\u00a0tables that have foreign key constraints back to a table that you&#8217;re working on. \u00a0Fortunately, SQL Server has a built &#8230;<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2}},"categories":[18,13],"tags":[16,29],"class_list":["post-205","post","type-post","status-publish","format-standard","hentry","category-system-views","category-t-sql","tag-quickies","tag-system-procedures"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.5 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>List All Foreign Keys Referencing A Table In SQL Server - SQL Nuggets<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"List All Foreign Keys Referencing A Table In SQL Server - SQL Nuggets\" \/>\n<meta property=\"og:description\" content=\"There may be times that you need to get\u00a0a list of\u00a0tables that have foreign key constraints back to a table that you&#8217;re working on. \u00a0Fortunately, SQL Server has a built ...\" \/>\n<meta property=\"og:url\" content=\"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Nuggets\" \/>\n<meta property=\"article:published_time\" content=\"2016-04-15T19:28:23+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2016-04-15T19:30:51+00:00\" \/>\n<meta name=\"author\" content=\"Eric Cobb\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@cfgears\" \/>\n<meta name=\"twitter:site\" content=\"@sqlnugg\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Eric Cobb\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/list-foreign-keys-referencing-table-sql-server\\\/#article\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/list-foreign-keys-referencing-table-sql-server\\\/\"},\"author\":{\"name\":\"Eric Cobb\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#\\\/schema\\\/person\\\/210536254addbc1b9d2d95dc1448b38a\"},\"headline\":\"List All Foreign Keys Referencing A Table In SQL Server\",\"datePublished\":\"2016-04-15T19:28:23+00:00\",\"dateModified\":\"2016-04-15T19:30:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/list-foreign-keys-referencing-table-sql-server\\\/\"},\"wordCount\":149,\"commentCount\":0,\"publisher\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#organization\"},\"keywords\":[\"Quickies\",\"System Procedures\"],\"articleSection\":[\"System Views\",\"T-SQL\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"http:\\\/\\\/www.sqlnuggets.com\\\/list-foreign-keys-referencing-table-sql-server\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/list-foreign-keys-referencing-table-sql-server\\\/\",\"url\":\"http:\\\/\\\/www.sqlnuggets.com\\\/list-foreign-keys-referencing-table-sql-server\\\/\",\"name\":\"List All Foreign Keys Referencing A Table In SQL Server - SQL Nuggets\",\"isPartOf\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#website\"},\"datePublished\":\"2016-04-15T19:28:23+00:00\",\"dateModified\":\"2016-04-15T19:30:51+00:00\",\"breadcrumb\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/list-foreign-keys-referencing-table-sql-server\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"http:\\\/\\\/www.sqlnuggets.com\\\/list-foreign-keys-referencing-table-sql-server\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/list-foreign-keys-referencing-table-sql-server\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"http:\\\/\\\/www.sqlnuggets.com\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"List All Foreign Keys Referencing A Table In SQL Server\"}]},{\"@type\":\"WebSite\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#website\",\"url\":\"http:\\\/\\\/www.sqlnuggets.com\\\/\",\"name\":\"SQL Nuggets\",\"description\":\"Nuggets Of SQL Server Knowledge\",\"publisher\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"http:\\\/\\\/www.sqlnuggets.com\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#organization\",\"name\":\"SQL Nuggets\",\"url\":\"http:\\\/\\\/www.sqlnuggets.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/sqlnuggets.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/website-logo.jpg\",\"contentUrl\":\"https:\\\/\\\/sqlnuggets.com\\\/wp-content\\\/uploads\\\/2023\\\/11\\\/website-logo.jpg\",\"width\":320,\"height\":54,\"caption\":\"SQL Nuggets\"},\"image\":{\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/sqlnugg\",\"https:\\\/\\\/www.linkedin.com\\\/in\\\/ericcobb\\\/\"]},{\"@type\":\"Person\",\"@id\":\"http:\\\/\\\/www.sqlnuggets.com\\\/#\\\/schema\\\/person\\\/210536254addbc1b9d2d95dc1448b38a\",\"name\":\"Eric Cobb\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg\",\"caption\":\"Eric Cobb\"},\"sameAs\":[\"https:\\\/\\\/x.com\\\/cfgears\"],\"url\":\"https:\\\/\\\/sqlnuggets.com\\\/author\\\/eric-cobb\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"List All Foreign Keys Referencing A Table In SQL Server - SQL Nuggets","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/","og_locale":"en_US","og_type":"article","og_title":"List All Foreign Keys Referencing A Table In SQL Server - SQL Nuggets","og_description":"There may be times that you need to get\u00a0a list of\u00a0tables that have foreign key constraints back to a table that you&#8217;re working on. \u00a0Fortunately, SQL Server has a built ...","og_url":"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/","og_site_name":"SQL Nuggets","article_published_time":"2016-04-15T19:28:23+00:00","article_modified_time":"2016-04-15T19:30:51+00:00","author":"Eric Cobb","twitter_card":"summary_large_image","twitter_creator":"@cfgears","twitter_site":"@sqlnugg","twitter_misc":{"Written by":"Eric Cobb","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/#article","isPartOf":{"@id":"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/"},"author":{"name":"Eric Cobb","@id":"http:\/\/www.sqlnuggets.com\/#\/schema\/person\/210536254addbc1b9d2d95dc1448b38a"},"headline":"List All Foreign Keys Referencing A Table In SQL Server","datePublished":"2016-04-15T19:28:23+00:00","dateModified":"2016-04-15T19:30:51+00:00","mainEntityOfPage":{"@id":"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/"},"wordCount":149,"commentCount":0,"publisher":{"@id":"http:\/\/www.sqlnuggets.com\/#organization"},"keywords":["Quickies","System Procedures"],"articleSection":["System Views","T-SQL"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/#respond"]}]},{"@type":"WebPage","@id":"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/","url":"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/","name":"List All Foreign Keys Referencing A Table In SQL Server - SQL Nuggets","isPartOf":{"@id":"http:\/\/www.sqlnuggets.com\/#website"},"datePublished":"2016-04-15T19:28:23+00:00","dateModified":"2016-04-15T19:30:51+00:00","breadcrumb":{"@id":"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/"]}]},{"@type":"BreadcrumbList","@id":"http:\/\/www.sqlnuggets.com\/list-foreign-keys-referencing-table-sql-server\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"http:\/\/www.sqlnuggets.com\/"},{"@type":"ListItem","position":2,"name":"List All Foreign Keys Referencing A Table In SQL Server"}]},{"@type":"WebSite","@id":"http:\/\/www.sqlnuggets.com\/#website","url":"http:\/\/www.sqlnuggets.com\/","name":"SQL Nuggets","description":"Nuggets Of SQL Server Knowledge","publisher":{"@id":"http:\/\/www.sqlnuggets.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"http:\/\/www.sqlnuggets.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"http:\/\/www.sqlnuggets.com\/#organization","name":"SQL Nuggets","url":"http:\/\/www.sqlnuggets.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"http:\/\/www.sqlnuggets.com\/#\/schema\/logo\/image\/","url":"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2023\/11\/website-logo.jpg","contentUrl":"https:\/\/sqlnuggets.com\/wp-content\/uploads\/2023\/11\/website-logo.jpg","width":320,"height":54,"caption":"SQL Nuggets"},"image":{"@id":"http:\/\/www.sqlnuggets.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/x.com\/sqlnugg","https:\/\/www.linkedin.com\/in\/ericcobb\/"]},{"@type":"Person","@id":"http:\/\/www.sqlnuggets.com\/#\/schema\/person\/210536254addbc1b9d2d95dc1448b38a","name":"Eric Cobb","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg","url":"https:\/\/secure.gravatar.com\/avatar\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3ca1fc0c7054a668e048f09d412cd4ebf89833c4630fbbfccca78a0678a6bdc2?s=96&d=mm&r=pg","caption":"Eric Cobb"},"sameAs":["https:\/\/x.com\/cfgears"],"url":"https:\/\/sqlnuggets.com\/author\/eric-cobb\/"}]}},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/pdyDvE-3j","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":581,"url":"https:\/\/sqlnuggets.com\/index-basics-find-tables-not-clustered-index\/","url_meta":{"origin":205,"position":0},"title":"Index Basics: Find Tables That Do Not Have A Clustered Index","author":"Eric Cobb","date":"October 17, 2017","format":false,"excerpt":"In a previous Index Basics post we went over the importance of having a Clustered Index on your tables, and we learned that SQL Server will automatically create a Clustered Index on the Primary Key column(s) of your table, unless you explicitly tell it not to. But what about tables\u2026","rel":"","context":"In &quot;Indexes&quot;","block_context":{"text":"Indexes","link":"https:\/\/sqlnuggets.com\/category\/indexes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":209,"url":"https:\/\/sqlnuggets.com\/index-basics-nonclustered-indexes-part-1\/","url_meta":{"origin":205,"position":1},"title":"Index Basics: Nonclustered Indexes, Part 1","author":"Eric Cobb","date":"February 18, 2016","format":false,"excerpt":"In SQL Server, an index is used to\u00a0speed the retrieval of data\u00a0from a\u00a0table. Indexes are built from one or more columns in the table, and SQL Server uses these Indexes to look up and retrieve data quickly and efficiently. \u00a0In order to effectively use Indexes in SQL Server, it's important\u2026","rel":"","context":"In &quot;Indexes&quot;","block_context":{"text":"Indexes","link":"https:\/\/sqlnuggets.com\/category\/indexes\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":468,"url":"https:\/\/sqlnuggets.com\/sql-scripts-find-index-usage\/","url_meta":{"origin":205,"position":2},"title":"SQL Scripts: How To Find Index Usage","author":"Eric Cobb","date":"July 11, 2017","format":false,"excerpt":"This post is part of an ongoing\u00a0SQL Scripts\u00a0series, in which I list useful queries that I use in my day to day database administration. If you are interested in code that will Persist And Aggregate Index Statistics\u00a0for your server, take a look at my\u00a0SQL Server Metrics Pack\u00a0project that is available\u2026","rel":"","context":"In &quot;Indexes&quot;","block_context":{"text":"Indexes","link":"https:\/\/sqlnuggets.com\/category\/indexes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/06\/board-electronics-computer-data-processing-50711-e1498160567831.jpeg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/06\/board-electronics-computer-data-processing-50711-e1498160567831.jpeg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/06\/board-electronics-computer-data-processing-50711-e1498160567831.jpeg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/06\/board-electronics-computer-data-processing-50711-e1498160567831.jpeg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/06\/board-electronics-computer-data-processing-50711-e1498160567831.jpeg?resize=1050%2C600&ssl=1 3x"},"classes":[]},{"id":201,"url":"https:\/\/sqlnuggets.com\/index-basics-clustered-indexes\/","url_meta":{"origin":205,"position":3},"title":"Index Basics: Clustered Indexes","author":"Eric Cobb","date":"January 21, 2016","format":false,"excerpt":"In SQL Server, an index is used to\u00a0speed the retrieval of data\u00a0from a\u00a0table. Indexes are built from one or more columns in the table, and SQL Server uses these Indexes to look up and retrieve data quickly and efficiently. \u00a0In order to effectively use Indexes in SQL Server, it's important\u2026","rel":"","context":"In &quot;Indexes&quot;","block_context":{"text":"Indexes","link":"https:\/\/sqlnuggets.com\/category\/indexes\/"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":1653,"url":"https:\/\/sqlnuggets.com\/the-power-of-proper-indexing\/","url_meta":{"origin":205,"position":4},"title":"The Power Of Proper Indexing","author":"Eric Cobb","date":"June 30, 2021","format":false,"excerpt":"This image is an actual screen shot of one of our production SQL Server's CPU usage, taken from our SQL Sentry monitoring system. Obviously this server was under some strain. Users were complaining that queries were taking 30+ seconds to run when they normally returned data in milliseconds. It eventually\u2026","rel":"","context":"In &quot;Indexes&quot;","block_context":{"text":"Indexes","link":"https:\/\/sqlnuggets.com\/category\/indexes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2021\/06\/image.jpeg?resize=350%2C200&ssl=1","width":350,"height":200},"classes":[]},{"id":554,"url":"https:\/\/sqlnuggets.com\/index-basics-hidden-costs-associated-indexes\/","url_meta":{"origin":205,"position":5},"title":"Index Basics: Hidden Costs Associated With Indexes","author":"Eric Cobb","date":"September 26, 2017","format":false,"excerpt":"I have a confession. When I was a developer, I didn't understand indexes in SQL Server. I rarely added them to my tables, and when I did there was not really any logic behind my decision, other than it was usually just because I thought a column might be queried\u2026","rel":"","context":"In &quot;Indexes&quot;","block_context":{"text":"Indexes","link":"https:\/\/sqlnuggets.com\/category\/indexes\/"},"img":{"alt_text":"","src":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=350%2C200&ssl=1","width":350,"height":200,"srcset":"https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=350%2C200&ssl=1 1x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=525%2C300&ssl=1 1.5x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=700%2C400&ssl=1 2x, https:\/\/i0.wp.com\/sqlnuggets.com\/wp-content\/uploads\/2017\/08\/mother-board-electronics-computer-board-39290-e1506443567415.jpeg?resize=1050%2C600&ssl=1 3x"},"classes":[]}],"_links":{"self":[{"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/posts\/205","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/comments?post=205"}],"version-history":[{"count":0,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/posts\/205\/revisions"}],"wp:attachment":[{"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/media?parent=205"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/categories?post=205"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sqlnuggets.com\/wp-json\/wp\/v2\/tags?post=205"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}