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

odiseh

I want to query the name of all columns of a table. I found how to do this in:

But I also need to know: how can this be done in Microsoft SQL Server (2008 in my case)?

anon

You can obtain this information and much, much more by querying the Information Schema views.

This sample query:

SELECT *
FROM INFORMATION_SCHEMA.COLUMNS
WHERE TABLE_NAME = N'Customers'

Can be made over all these DB objects:

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

How can I select a column from my table, and get very nth row based on the value in that column in SQL Server?

From Dev

In SQL Server, how do I retrieve data values from table column names identified in a sub-query?

From Dev

How to get the table names from "SQL script" in SQL Server database

From Dev

How can i get a list of total sums based off names in a table and their points (from column)?

From Dev

SQL Get the column names from a table as data?

From Dev

How to get all column names without one column in sql table in SQL Server

From Dev

How can I get count of column a into the column b in SQL Server?

From Dev

How can I copy one column to from one table to another in SQL Server

From Dev

How can I parse data from one column in a table and put the result into another with SQL Server?

From Dev

How can i select row from table according to column values of row in sql server

From Dev

How can I get table records passing table name and column names at runtime in hibernate?

From Dev

How can I create a SQL table variable using records in another table as column names

From Dev

How can I get row's index from a table in SQL Server?

From Dev

SQL Server: How can I get data from junction table that only has IDs?

From Dev

How can I get the count depending on the column value in SQL Server

From Dev

How to extract table names and column names from sql query?

From Dev

How to Copy data from XML Column and Insert it into a Table which Contains column names same as XML Tag Names in MS SQL SERVER

From Dev

How to Copy data from XML Column and Insert it into a Table which Contains column names same as XML Tag Names in MS SQL SERVER

From Dev

How to get list of constraints of a table along with their respective column names in SQL Server 2008 R2

From Dev

How to get few column names among all columns in the one table with query in sql server 2008

From Dev

How can I get the attributes from a mysql table by specific column?

From Dev

How can I get just one column from a table?

From Dev

How can I get the required column from this table?

From Dev

How can I get data type of each column in a SQL Server table/view etc. using C# Entity Framework?

From Dev

How can I look up column names in a SQL Server with an odd schema?

From Dev

Get dynamic column names from another table for SQL Update

From Dev

I need to get column names from a table in hibernate

From Dev

How can we separate arabic names from a column in SQL Server 2012?

From Dev

how can i melt a data.table with concatenated column names

Related Related

  1. 1

    How can I select a column from my table, and get very nth row based on the value in that column in SQL Server?

  2. 2

    In SQL Server, how do I retrieve data values from table column names identified in a sub-query?

  3. 3

    How to get the table names from "SQL script" in SQL Server database

  4. 4

    How can i get a list of total sums based off names in a table and their points (from column)?

  5. 5

    SQL Get the column names from a table as data?

  6. 6

    How to get all column names without one column in sql table in SQL Server

  7. 7

    How can I get count of column a into the column b in SQL Server?

  8. 8

    How can I copy one column to from one table to another in SQL Server

  9. 9

    How can I parse data from one column in a table and put the result into another with SQL Server?

  10. 10

    How can i select row from table according to column values of row in sql server

  11. 11

    How can I get table records passing table name and column names at runtime in hibernate?

  12. 12

    How can I create a SQL table variable using records in another table as column names

  13. 13

    How can I get row's index from a table in SQL Server?

  14. 14

    SQL Server: How can I get data from junction table that only has IDs?

  15. 15

    How can I get the count depending on the column value in SQL Server

  16. 16

    How to extract table names and column names from sql query?

  17. 17

    How to Copy data from XML Column and Insert it into a Table which Contains column names same as XML Tag Names in MS SQL SERVER

  18. 18

    How to Copy data from XML Column and Insert it into a Table which Contains column names same as XML Tag Names in MS SQL SERVER

  19. 19

    How to get list of constraints of a table along with their respective column names in SQL Server 2008 R2

  20. 20

    How to get few column names among all columns in the one table with query in sql server 2008

  21. 21

    How can I get the attributes from a mysql table by specific column?

  22. 22

    How can I get just one column from a table?

  23. 23

    How can I get the required column from this table?

  24. 24

    How can I get data type of each column in a SQL Server table/view etc. using C# Entity Framework?

  25. 25

    How can I look up column names in a SQL Server with an odd schema?

  26. 26

    Get dynamic column names from another table for SQL Update

  27. 27

    I need to get column names from a table in hibernate

  28. 28

    How can we separate arabic names from a column in SQL Server 2012?

  29. 29

    how can i melt a data.table with concatenated column names

HotTag

Archive