Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Import/Export (DTS) and Replication (2000)
 How to export SQL server field names and data types

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2002-05-10 : 09:19:29
Mark writes "I have a large d/b with many tables. What I need to do is to export all the field names and data types within every table into either a spreadsheet or an ASCII text file. Help!

Thanks,
Mark."

timmy
Master Smack Fu Yak Hacker

1242 Posts

Posted - 2002-05-10 : 09:28:33
Check out the INFORMATION_SCHEMA view called COLUMNS.

Go to Top of Page

efelito
Constraint Violating Yak Guru

478 Posts

Posted - 2002-05-13 : 10:39:43
If you have a little programming experience, this is very easy to do using VBA in MS Word or Excel with SQLDMO.

Jeff Banschbach
Consultant, MCDBA
Go to Top of Page

YellowBug
Aged Yak Warrior

616 Posts

Posted - 2002-05-14 : 05:28:08
Step 1.
I can't see any INFORMATION_SCHEMA views from Excel, but if you can then Step 1 is unnecessary.
CREATE VIEW viewOfDataModel
AS
select * from INFORMATION_SCHEMA.COLUMNS
GO

Step 2.
In Excel. Data --> Get External Data
Select/Create a data source to the database, and select the new view.


This will pull in all the data and column headings.
Go to Top of Page
   

- Advertisement -