Quantcast
Channel: VBForums - Database Development
Viewing all articles
Browse latest Browse all 2918

Where Is My Metadata?

$
0
0
I wrote something to update the extended properties metadata for a table in SQL Server (I forget the version, but something like 2017). To do this, I call the sp_AddExtendedProperty
with these parameters:
Code:

            cmd.Parameters("@name").Value = "OWNERS"
            cmd.Parameters("@value").Value = ownString
            cmd.Parameters("@level0type").Value = "SCHEMA"
            cmd.Parameters("@level0name").Value = [Enum].GetName(GetType(HISInCommon.Schema), tableHold.DBSchema)
            cmd.Parameters("@level1type").Value = "TABLE"
            cmd.Parameters("@level1name").Value = tableHold.TableNameBase

Now, this all works. I know it works because these often don't change (the metadata very rarely changes), so the first thing I do is read any existing metadata and compare it to what it should be, updating as needed. By doing this, and stepping through the code, I see that the metadata is correctly being stored. The thing is, I can't find it.

My understanding was that I could go into SSMS, look at the Properties for a table, then look at Extended Properties, and there it would be, with the name field holding OWNERS, and the value field holding whatever is in ownString. However, when I go and look there...it's empty. There are no extended properties at all, even though when I get the OWNERS property back from the table, I get back exactly what I am expecting.

So, it's being stored somewhere, but where? Am I doing it wrong? It's working, so it can't be all THAT wrong, but it should be visible and it is not.

Viewing all articles
Browse latest Browse all 2918

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>