Skip to content

pelnar.tech

Menu
  • HOME
  • Categories
    • Uncategorized
Menu

Structure of SQL Databases

Posted on May 1, 2024 by admin

Recently I’ve had to get a sense for the structure of a database in order to communicate it to a vendor. One of those vendors gave me a query that helps determine the entire structure:

SELECT
t.name AS TableName,
c.name AS ColumnName
FROM
sys.tables t
INNER JOIN
sys.columns c ON t.object_id = c.object_id
ORDER BY
t.name, c.name;

The output of this is the table name in Column A and the Field Name in Column B.

Leave a Reply Cancel reply

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

Recent Posts

  • Apollo Transposition, Docking, and Extraction
  • Powershell: Email
  • SQL FIXES
  • SQL LOOKUP TABLE
  • SQL RELOADING DATABASE

Recent Comments

No comments to show.

Archives

  • November 2024
  • October 2024
  • September 2024
  • May 2024
  • April 2024

Categories

  • Uncategorized
©2025 pelnar.tech | Design: Newspaperly WordPress Theme