I'm trying to know where SN saves versioning mode in its database for a specific container such as a folder!
I found [Status] column in [Versions] table but I noticed that its value remains 1 even though I changed the mode from major to none and vise-versa.
I also traced it through SQL Profiler and found the following stored proc. triggered: proc_Version_Update.
Please elaborate. Thanks!
If you need a db solution (which is not the recommended one, use the REST or C# api if you can), you may take a look at the built-in database views. They will save you a few joins :-).
Versioning mode on containers is a regular field, called Inheritable versioning mode. Please note that this value determines the versioning behavior of child elements in that container, not the container's own versioning mode. If you need a value set on individual content items (like documents), look for the VersioningMode property.
The value you are looking for is stored in the FlatProperties table, as any other simple property, but it is easier to query using the view below.
Please execute the following script to find the correct column in the FlatProperties table:
SELECT [Id], [Page], [Column]
FROM [dbo].[PropertyInfoView]
where Name = 'InheritableVersioningMode'
The last column will contain the column name you need (e.g. int_3). Please also take a note of the Page value: sometimes there are so many fields in the system that a version occupies more than one row in the FlatProperties table.
Execute the second script with the container path you are looking for (please change the last selected column to the one you have found in your db):
SELECT [NodeId], [Name], [Path], [VersionId], [int_3]
FROM [dbo].[SysSearchWithFlatsView]
where Path = @yourPath
The last column value will be the enum value (a number) you are looking for, one of the following:
Inherited = 0
None = 1
MajorOnly = 2
MajorAndMinor = 3