T-SQL script for extended properties

660 Views Asked by At
Database  DatabaseDesc TableDesc ColumnDesc StoredProcedureDesc ParameterDesc FunctionDesc 
'DB Name'   100%        90%      80%         75%                 76%             40%

If extended property for database description exists column DatabaseDesc is 100%, if not 0%. If you have 20 tables within the database and 15 having a description then TableDesc is 75 % and so on.Need help to write the T-SQL script that will generate this info in the above form.

1

There are 1 best solutions below

0
On

I might be able to help but I need more information . Sounds like you need: CASE WHEN . There is several ways it could be done. You might try a left outer join then a case when tabledesc is null the 0 else 1 end. There would me more to it but it's a start. For me I have to test it out and know the database to get it to work. So it's hard to tell you without me testing it.