+ Reply to Thread
Results 1 to 4 of 4

What sql command tells us the table structure?

  1. What sql command tells us the table structure?

    I know that in Oracle, we can issue something like

    desc my_table;

    and we'll get a display of the table structure.

    I have been searching around for similar functions of MS SQL Server,
    but cannot find anything. Is there any SQL Server command that
    describes table structures for us? Thanks.

  2. Re: What sql command tells us the table structure?

    Hi

    Try this:

    EXEC sp_help my_table;

    --
    HTH
    Kalen Delaney, SQL Server MVP
    www.InsideSQLServer.com
    http://blog.kalendelaney.com


    "gnewsgroup" wrote in message
    news:59fc4099-024e-4b11-9d15-32aed033890e@p73g2000hsd.googlegroups.com...
    >I know that in Oracle, we can issue something like
    >
    > desc my_table;
    >
    > and we'll get a display of the table structure.
    >
    > I have been searching around for similar functions of MS SQL Server,
    > but cannot find anything. Is there any SQL Server command that
    > describes table structures for us? Thanks.




  3. Re: What sql command tells us the table structure?

    On Feb 26, 4:40 pm, "Kalen Delaney"
    wrote:
    > Hi
    >
    > Try this:
    >
    > EXEC sp_help my_table;
    >
    > --
    > HTH
    > Kalen Delaney, SQL Server MVPwww.InsideSQLServer.comhttp://blog.kalendelaney.com
    >
    > "gnewsgroup" wrote in message
    >
    > news:59fc4099-024e-4b11-9d15-32aed033890e@p73g2000hsd.googlegroups.com...
    >
    > >I know that in Oracle, we can issue something like

    >
    > > desc my_table;

    >
    > > and we'll get a display of the table structure.

    >
    > > I have been searching around for similar functions of MS SQL Server,
    > > but cannot find anything. Is there any SQL Server command that
    > > describes table structures for us? Thanks.


    Ha, thanks a lot. Never thought that such functionality can be named
    something like "help".

  4. Re: What sql command tells us the table structure?

    You can also do

    SELECT *
    FROM INFORMATION_SCHEMA.COLUMNS
    WHERE TABLE_NAME = 'YourTableName';

    I had a similar problem going to Oracle. It took me a while to discover desc;

    Bob

    "gnewsgroup" wrote:

    > On Feb 26, 4:40 pm, "Kalen Delaney"
    > wrote:
    > > Hi
    > >
    > > Try this:
    > >
    > > EXEC sp_help my_table;
    > >
    > > --
    > > HTH
    > > Kalen Delaney, SQL Server MVPwww.InsideSQLServer.comhttp://blog.kalendelaney.com
    > >
    > > "gnewsgroup" wrote in message
    > >
    > > news:59fc4099-024e-4b11-9d15-32aed033890e@p73g2000hsd.googlegroups.com...
    > >
    > > >I know that in Oracle, we can issue something like

    > >
    > > > desc my_table;

    > >
    > > > and we'll get a display of the table structure.

    > >
    > > > I have been searching around for similar functions of MS SQL Server,
    > > > but cannot find anything. Is there any SQL Server command that
    > > > describes table structures for us? Thanks.

    >
    > Ha, thanks a lot. Never thought that such functionality can be named
    > something like "help".
    >


+ Reply to Thread