Upper Case Formula In Field Defination

  • How can I put a formula in field defination using enterprise manage so that the data entered by user is converted to uppercase

  • You could use a trigger to force it.

    create trigger mytrig on Mytable for insert, update as

    update mytable

     set myfield = upper(myfield)

     from inserted i

     where i.pk = mytable.pk

     

  • If possible I want to use formula property of field to achieve the same.

    Thanks for the reply.

  • Don't know how to do it in field def.  Why not write the code to always UPPER(textbox.value)?????



    Good Hunting!

    AJ Ahrens


    webmaster@kritter.net

  • As I just started using Sql Server I want to use as much option as possible in Sql Server. I can do it in Front End but that would leave me without knowing the use of formula property in Filed Defination While using Sql Server.

  • I'm pretty sure you can't do a self reference in the "Formula" for a field. This is due to the fact that "Formula" makes the field a computed column and thus the result of a formula derived from an expression that may reference another field in the record. Lookup "Expressions and Computed Columns in INSTEAD OF Triggers" in SQL Books Online.




    Gary Johnson
    Microsoft Natural Language Group
    DBA, Sr. DB Engineer

    This posting is provided "AS IS" with no warranties, and confers no rights. The opinions expressed in this post are my own and may not reflect that of my employer.

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply