About 17,800 results
Open links in new tab
  1. How can I show the table structure in SQL Server query?

    Aug 18, 2013 · There are different ways to get the schema. Using ADO.NET, you can use the schema methods. Use the DbConnection 's GetSchema method or the DataReader 's GetSchemaTable method. Provided that you have a reader for the for the query, you can do something like this: using(DbCommand cmd = ...) var schema = reader.GetSchemaTable();

  2. sql server - Printing table's structure/schema - Stack Overflow

    Feb 15, 2009 · You can use Database Schema Diagram Design Tool. Just drop all the tables there, and you will get the diagram of you database including all keys

  3. sql server - Query to return database, schema, table, column for …

    Mar 5, 2019 · For SchemaName, TableName, ColumnName, ColumnType can be found in Select * from INFORMATION_SCHEMA.COLUMNS as ColumnNames here. For Getting database names you can use select * from sys.databases. When user select the database you can change your connection string and get the column info.

  4. How to view table structure in SQL? - TablePlus

    Sep 11, 2019 · To show the table structure with all its column’s attributes: name, datatype, primary key, default value, etc. In SQL Server, use sp_help function: In MySQL and Oracle, you can use DESCRIBE: Or. In PostgreSQL, here is the go-to statement: INFORMATION_SCHEMA.COLUMNS. TABLE_NAME = table_name; In SQLite, it’s …

  5. Methods used to extract database schema information

    Jan 28, 2025 · SELECT table_name as 'Table Name', column_name as 'Column Name', data_type as 'Data Type', character_maximum_length as 'Char Max Length', column_default as 'Default Value', is_nullable as 'Nullable', numeric_precision as 'Precision', numeric_precision_radix as 'Precision Radix' FROM information_schema.columns WHERE table_catalog = 'Altiris'

  6. List all table names in particular schema in SQL Server

    Feb 5, 2019 · select name as table_name from sys.tables where schema_name(schema_id) = 'HumanResources' -- put your schema name here order by name; Columns table_name - table name in provided schema

  7. SQL Server Describe Table - Tpoint Tech - Java

    Mar 17, 2025 · If we want to get the table definition of a 'Users' table, we can use it as follows: SELECT * FROM information_schema.columns WHERE table_name = 'Users'; It will produce the following output:

  8. Microsoft SQL Server Tutorial => Get all schemas, tables, columns...

    SELECT s.name AS [schema], t.object_id AS [table_object_id], t.name AS [table_name], c.column_id, c.name AS [column_name], i.name AS [index_name], i.type_desc AS [index_type] FROM sys.schemas AS s INNER JOIN sys.tables AS t ON s.schema_id = t.schema_id INNER JOIN sys.columns AS c ON t.object_id = c.object_id LEFT JOIN sys.index_columns AS ic ON ...

  9. 3 Ways to Get the Schema of a Result Set in SQL Server - Database.Guide

    Oct 30, 2020 · Fortunately there are several ways you can go about getting such metadata for a result set in SQL Server. The sp_describe_first_result_set system stored procedure was designed specifically for returning the metadata for a result set. It …

  10. SQL Server Schema Output - Stack Overflow

    Jun 27, 2011 · How do I output the schema of my database? I want it to output the design of the database. Something like this might work: SELECT TABLE_TYPE, TABLE_NAME, COLUMN_NAME, DATA_TYPE, CHARACTER_MAXIMUM_LENGTH. FROM INFORMATION_SCHEMA.COLUMNS. ORDER BY TABLE_TYPE, TABLE_NAME, COLUMN_NAME . But I can't get it to run correctly.

  11. Some results have been removed
Refresh