Hi Diane,
Try this from the database you want the details from
SELECT o.name AS s1, USER_NAME(o.uid) AS s2, C.name
FROM dbo.sysobjects o INNER JOIN
dbo.syscolumns C ON o.id = C.id
WHERE (OBJECTPROPERTY(o.id, N'IsTable') = 1) AND (OBJECTPROPERTY(o.id,
N'IsSystemTable') = 0) AND (o.name NOT LIKE N'#%')
ORDER BY o.name, C.colid
There more info in these two table so you should look in BOL for syscolumns
and sysobjects
--
kind regards
Greg O
Need to document your databases. Use the first and still the best AGS SQL
Scribe
http://www.ag-software.com [quoted text, click to view] "Diane" <someone@example.com> wrote in message
news:45667ED1-5D6E-4A70-A8A2-B66C1EC40887@microsoft.com...
> Hello.
>
> Thank you for taking the time to read my question.
>
> Does anyone know how to pull a list of user tables and their associated
> fields?
>
> To give you a better idea, I imagine the statement to look something like
> this -
>
> Select userTableName, userTableField
> From userTableInfo
> GroupBy TableName, userTableField
> OrderBy TableName, userTableField
>
> The report will (hopefully) resemble something like this -
>
> TableA
> TableA.Field1
> TableA.Field2
> TableA.Field3
> etc....
> TableB
> TableB.Field1
> TableB.Field2
> TableB.Field3
> etc....
> TableC
> TableC.Field1
> TableC.Field2
> TableC.Field3
> etc....
> Etc.....
>
>
> I'm not sure if table names and their fields are in one table, as I have
> not
> worked with a DB without having documentation on the tables and fields.
>
> Thank you for any tips or suggestions you can contribute!
>
> Best-
> Diane
>