Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where are extended properties stored in SQL Server?

Where are extended properties stored in SQL Server?

Are they stored in the database containing the object it was added to, or are they stored separately and bound to the local machine somehow.

For example, if I add populate the "Description" field (MS_Description extended property) in SSMS to document a table's column, and I then shut down the database engine and copy the MDF/LOG files out to attach it to a different machine, will the extended properties go with the copied file, or will they get left behind in the master database (or something like that) on the local machine?

like image 235
Triynko Avatar asked Jun 15 '11 21:06

Triynko


2 Answers

They are stored in the database. You can get them by querying the view sys.extended_properties and they are stored in System Base Table sys.sysxprops.

like image 168
Mikael Eriksson Avatar answered Sep 17 '22 14:09

Mikael Eriksson


From MSDN:

"[…E]xtended properties are stored in the database[.]"

So yes, when you create a backup and/or move the database, the extended properties go with it.

like image 40
RThomas Avatar answered Sep 18 '22 14:09

RThomas