Getting the primary key column from a table

Many a times we need to know which is the primary key column in a table,when we enforce data checks in presentation layer.

Executing this query using ADO.NET will retrieve the primary key column of a given table.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.