MS_Description field

4 posts, 0 answers
  1. Sasa
    Sasa avatar
    25 posts
    Member since:
    Jul 2013

    Posted 23 Jul 2013 Link to this post


    in SQL Server there is an description property (in sys.extended_properties) of tables, columns (which I very much like :) ) and since I'm using  OpenAccess fluent mapping api for defining my database model - is there a way to set the values ​​of these 'MS_Description' fields in OpenAccess code-first way of modeling my database?

  2. Kristian Nikolov
    Kristian Nikolov avatar
    206 posts

    Posted 24 Jul 2013 Link to this post

    Hi Sasa,

    Unfortunately, OpenAccess does not currently support out of the box manipulation of extended properties or other metadata fields. Thus I would offer you to vote for this feature request, which would help us to eventually decide to implement such functionality based on the interest show towards it.

    You can still work with extended properties by taking advantage of our context method for executing stored procedures and SQL statements in conjunction with the following stored procedures: sp_addextendedproperty, sp_updateextendedproperty, sp_dropextendedproperty. In case you want to also retrieve extended properties, you could make use of the methods described in this MSDN article. Note that this approach is considered a workaround and may prove inefficient in complex scenarios.

    Please find attached a sample project which demonstrates adding, updating and removing extended properties via the aforementioned stored procedures. Retrieving the properties is achieved by using the table valued function fn_listextendedproperty. The sample will create a simple database with a single table Customer: ID, Name, Email, DateCreated.

    In order to deploy the sample you will have to:
    - Extract the project.
    - Open the solution in VisualStudio
    - Upgrade OpenAccess references.
    - Add you connection string to the .config files in both projects - CustomerModel and                                  ManipulateExtendedProperties.
    - Change the value of the connectionStringName variable with the name of your connection string. The variable is located in project CustomerModel, file FluentModel, class CustomerModelContext.
    - Select ManipulateExtendedProperties as the start project
    - Uncomment the methods according to the scenario you wish to explore
    - Run the project in debug mode

    Please note that when retrieving the properties, their SQL type is sql_variant and its respective C# CLR type is Object.

    I hope this information was helpful to you. In case you have additional questions, do not hesitate to contact us again.

    Kristian Nikolov
    OpenAccess ORM Q2 2013 brings you a more powerful code generation and a unique Bulk Operations support with LINQ syntax. Check out the list of new functionality and improvements shipped with this release.
  3. DevCraft banner
  4. Allen
    Allen avatar
    42 posts
    Member since:
    Nov 2014

    Posted 06 Jan 2015 in reply to Kristian Nikolov Link to this post

    hi, Kristian Nikolov.
    Please See
  5. Viktor Zhivkov
    Viktor Zhivkov avatar
    290 posts

    Posted 09 Jan 2015 Link to this post

    Hi Allen,

    You are welcome to post your feature suggestions in our Ideas and Feedback portal.
    There other clients will be able to see your suggestion, comment and vote for it if they want to support it.

    Viktor Zhivkov
    OpenAccess ORM is now Telerik Data Access. For more information on the new names, please, check out the Telerik Product Map.
Back to Top