Hi books online for 2005 states that the following code can list extended properties for all tables in a schema, however I get nothing returned when I execute it.
SELECT objtype, objname, name, value
FROM fn_listextendedproperty (NULL, 'schema', 'dbo', 'table', default, NULL, NULL);
Anybody have any ideas on how to get this going
Thanks,
Ned

fn_listextendedproperty sql 2005
Terp
You wouldn't happen to know the parameters required for that would you I'll play around and see if I can get it.
Regards,
Ned
ian530555
Hi,
Yup, I'm sure. I have 80 tables and most of them have comments on each column.
I executed in aventureworks and got the same results you did.
However, in my database, if I specify a specific table:
SELECT objtype, objname, name, value
FROM fn_listextendedproperty (NULL, 'schema', 'dbo', 'table', 'Agency', 'column', default);
I get the extended attribute values.
However, if I use the code that specifies it should retrieve the data for all columns, it doesn't work (I get nothing back):
SELECT objtype, objname, name, value
FROM fn_listextendedproperty (NULL, 'schema', 'dbo', 'table', default, NULL, NULL);
I decided to create another db. And the second query does not list out the extended attributes in the new db either...just the first query where I specify table name.
Regards,
Ned
Philip York
OliNagel
I ended up writing a cursor, but this is more elegant.
Regards,
Ned
timothy leung