Results 1 to 6 of 6
  1. #1
    Join Date
    Mar 2004
    Posts
    55

    Unanswered: Question on SQL Server SQL

    In DB2 one can issue a query like

    db2 -x 'select tabname from syscat.tables'

    and the output is cleaned up so all you get is/are the requested table
    name(s)...no dotted lines...no column headings.

    Does SQL Server have a similar construct?

    Thanks
    Gerry

  2. #2
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by SnowCrash7
    no dotted lines...no column headings.
    ?????

    Check out the information_schema views in bol. Otherwise check out system tables also in bol. Without the version of SS you are using I can't be more specific.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  3. #3
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    I think what you are looking for is bcp.exe

    it's a console app for exporting data from SQL Server to a flat file.

  4. #4
    Join Date
    Feb 2004
    Location
    One Flump in One Place
    Posts
    14,912
    Quote Originally Posted by jezemine
    I think what you are looking for is bcp.exe
    Ah! Now I get it.
    Testimonial:
    pootle flump
    ur codings are working excelent.

  5. #5
    Join Date
    May 2004
    Location
    Seattle
    Posts
    1,313
    specifically:

    bcp "select name from mydatabase.dbo.sysobjects where xtype='U'" queryout file.txt -c -T -SSERVERNAME

  6. #6
    Join Date
    Mar 2004
    Posts
    55

    Okay

    Sorry about not posting the version.
    Its SQL Server 2005.

    Ok so it seems that SQL Server SQL does not have the -x construct and that the bcp.exe is needed.

    Thanks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •