About 271,000 results
Open links in new tab
  1. sql - How do I list all the columns in a table? - Stack Overflow

    Oct 16, 2009 · SELECT COLUMN_NAME FROM information_schema.columns WHERE TABLE_NAME = 'my_table' AND TABLE_SCHEMA = 'my_database'; You need to both …

  2. How can I show the table structure in SQL Server query?

    Aug 18, 2013 · For SQL Server, if using a newer version, you can use. select * from INFORMATION_SCHEMA.COLUMNS where TABLE_NAME='tableName' There are different …

  3. How do I get list of all tables in a database using TSQL?

    Oct 6, 2008 · Any of the T-SQL code below will work in SQL Server 2019:-- here, you need to prefix the database name in INFORMATION_SCHEMA.TABLES SELECT TABLE_NAME …

  4. How can I get column names from a table in SQL Server?

    Jun 28, 2009 · --This is another variation used to document a large database for conversion (Edited to --remove static columns) SELECT o.Name as Table_Name , c.Name as …

  5. sql server - Selecting an entire table in SQL - Stack Overflow

    Apr 29, 2015 · SELECT * FROM table_name; This is how it works, the star will return all the records available in the specified table. Recommendation: Avoid using the star (*), use explicit …

  6. How to display table data more clearly in oracle sqlplus

    You do this by typing those commands into SQL Plus before running the query. Or you can put these commands and the query into a script file e.g. myscript.sql and run that. For example: …

  7. sql - Describe table structure - Stack Overflow

    Jun 7, 2017 · sqlite3: .schema table_name; Postgres (psql): \d table_name; SQL Server: sp_help table_name (or sp_columns table_name for only columns) Oracle DB2: desc table_name or …

  8. How to print the structure of a table and its contents in SQL

    Dec 28, 2010 · DESC or DESCRIBE : Used to describe the table structure present in the tablespace. USE : DESC e.g. DESC Employee; USE : SELECT * FROM to view all the data …

  9. sql - Displaying the constraints in a table - Stack Overflow

    Apr 13, 2017 · Hello I am trying to display the constraints in one of my tables but for some reason I get the message no rows selected. Noted below is the table I have created. Create table …

  10. Finding duplicate values in a SQL table - Stack Overflow

    It uses a common table expression (CTE) and a partition window (I think these features are in SQL 2008 and later). This example finds all students with duplicate name and dob. The fields …

Refresh