Showing posts with label newsgroupi. Show all posts
Showing posts with label newsgroupi. Show all posts

Monday, March 12, 2012

How to list atributes of all tables in Query Analyzer

Hi newsgroup
I need to know the properties of all tables in a given database on MSSQL
7.0. I know that there is a stored procedure with the name "sp_MShelpcolumns"
as well as another one called "sp_MSforeachtable". How can I combine these
two to get a result that looks like: tablename, columnname, datatype, size.
The result is something that I would like to copy and paste in Excel to send
it to a business analyst.
Any input is highly appreciated.
Kind regards
Gabriel
You want this ?
select table_name,column_name,Data_type,Character_maximum _length from
information_schema.columns
Thanks
"Gabriel Martin" <GabrielMartin@.discussions.microsoft.com> wrote in message
news:152308E6-5A4B-486E-9AF1-1735A1158881@.microsoft.com...
> Hi newsgroup
> I need to know the properties of all tables in a given database on MSSQL
> 7.0. I know that there is a stored procedure with the name
"sp_MShelpcolumns"
> as well as another one called "sp_MSforeachtable". How can I combine these
> two to get a result that looks like: tablename, columnname, datatype,
size.
> The result is something that I would like to copy and paste in Excel to
send
> it to a business analyst.
> Any input is highly appreciated.
> Kind regards
> Gabriel