First things first: I am using Microsoft SQL Server Management Studio (if you need more information, just tell me).
Here is my problem: I have a really high number of tables and I am trying to bring some structure to it.
My team decided to 'just' add certain extended properties to each table:
- Name
- Date
- Link to Doku
Each table should have at these 3 ext. properties. And of course there should be an info at the value of each of them.
Now I am trying to use a script to get all the tables which do NOT have those extended properties.
So the result of the script should be:
A list of all tables which
- missing one or more of the "must have" extended properties
- missing the value of one or more of the "must have" extended properties
At the end a result table would be nice - something like
TableName | Problem |
---|---|
Table_A | Missing ext. property |
Table_B | missing value |
I tried things like
select t.name as tablename, p.*
from sys.tables t
left join sys.extended_properties p on t.object_id = p.major_id
to get a list of all tables and ext. properties.
But I have no clue to get the list I was talking about at the beginning.
Any ideas?
Chris