Desc SQL Tables

When working with Oracle, SQL Server, or MySQL you might need to remind yourself the names of the columns for a table, I know I do. To describe the details of a table you can execute the following from a Oracle or MySQL client.

[source:sql]
desc <table_name>
[/source]

And just like everything else that Microsoft does, SQL Server does not follow the conventions or standards of other vendors and instead uses a different keyword to describe a given table. In SQL Server you display detailed information about a table use the sp_help command.

[source:sql]
sp_help <table_name>
[/source]

If you are interested in listing all the available tables in a database, for either Oracle, SQL Server, or MySQL, then you might want to take a look at the Show SQL Tables post.

Technorati Tags: , , , ,