Wednesday, March 21, 2012

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
Gerryno 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.|||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.|||I think what you are looking for is bcp.exeAh! Now I get it.|||specifically:

bcp "select name from mydatabase.dbo.sysobjects where xtype='U'" queryout file.txt -c -T -SSERVERNAME|||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

No comments:

Post a Comment