更改SQL SERVER 2008 R2中保存的数据的大小写 [英] Change Case of data saved in SQL SERVER 2008 R2

查看:159
本文介绍了更改SQL SERVER 2008 R2中保存的数据的大小写的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个查询,

 更新标题
SET title =
UPPER( LEFT (title, 1 ))+
LOWER( RIGHT (标题,LEN(标题) - 1 ))





我可以使用此更改数据的情况并且输出是我的问题在这里但我想要这个我的问题在这里,即在正确的情况下。请帮忙...

解决方案

阅读: SQL Server:将所有UPPER案例设置为正确案例/标题案例 - 堆栈溢出 [ ^ ]


这在很多方面存在缺陷:首先是这不是正确的案例 - 这是正确的案例:也称为句子案例。

你要求的是一个糟糕的标题案例形式:这是标题案例,其中主要词语以大写字母开头。

标题案例很复杂:< a href =http://grammar-monster.com/lessons/capital_letters_title_case.htm>什么是标题案例? [ ^ ]

即使你忽略了文章(a,an,the),连词(例如,和,但是,或)和介词(例如,on,in,with)排除,它是复杂的,最好用C#,VB或C ++等通用语言完成。

但它有可能: SQL Server:将所有UPPER案例设置为正确案例/标题案例 - 堆栈溢出 [ ^ ]

I have a query,

UPDATE titles
  SET title =
      UPPER(LEFT(title, 1)) +
        LOWER(RIGHT(title, LEN(title) - 1))



I can Change the case of data using this and out put is "My question is here" but I want this as "My Question Is Here" i.e. in Proper case. Please help...

解决方案

Read this : SQL Server: Make all UPPER case to Proper Case/Title Case - Stack Overflow[^]


That is flawed in so many ways: firstly "This Is Not Proper Case" - "This is proper case": also knows as Sentence case.
What you are asking for is a poor form of Title Case: "This is Title Case Where Main Words Start With Upper Case".
And Title case is complicated: What Is Title Case?[^]
Even if you ignore the "Articles (a, an, the), Conjunctions (e.g., and, but, or), and Prepositions (e.g., on, in, with)" exclusion, it's complicated and best done in a general purpose language such as C#, VB, or C++ instead.
But it is possible: SQL Server: Make all UPPER case to Proper Case/Title Case - Stack Overflow[^]


这篇关于更改SQL SERVER 2008 R2中保存的数据的大小写的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆