I need to get a list of all tables and fields that are currently on sql database this is for info only. We are thinking of a new system and I have been asked for all tables and fields within eg. table names field names field sizes etc etc..
I would like this in csv or txt so that I can email the info.
Why csv? A bit hard to read.
You can generate create table scripts from enterprise manager.
(I don't know how but it's been discussed earlier so a search or a look in the docs would surely help you out.)
In Ent.Mgr., highlight the tables icon, go to the Tools menu, and pull-down the Generate SQL Script... item. Should be pretty much self-explanatory from there.
In Query Analyzer, select Tools | Options and click on the Results tab. Select Comma Delimited for the Results output format. Run the following query and save the result to a file. You may find that you want to omit some of the columns from the output.
Use databsename
Select * from information_schema.columns
If you want to get the best answer for your question read faq183-874 and faq183-3179. Terry L. Broadbent - DBA
SQL Server Page:
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.