【YoTi】女程序员的历史

【一个初中生转变成程序员的故事】软件是为生活而生,懂得生活才能开发更好的作品。将生活融入到软件,将软件融入到生活,二者合一...

【数据库SQL】将小写修改为大写

use hbposev9
go
delete from pbcatcol where pbc_tnam = 't_bd_item_info2'
go
delete from pbcatcol where pbc_tnam = 't_pc_branch_price2'
go
--将货号中存在小写的字母修改成大写
declare @ls_tablename varchar(50),@ls_sql varchar(500)
declare test_cur cursor for
SELECT pbc_tnam
        FROM pbcatcol 
        WHERE pbc_cnam = 'item_no'
        ORDER BY pbc_tnam  
        for read only
open test_cur
fetch test_cur into @ls_tablename;
while @@fetch_Status = 0
begin
set @ls_sql='update' +'  '  +@ls_tablename+'   set item_no=upper(item_no)'
exec( @ls_sql)
fetch test_cur into @ls_tablename;
end
close test_cur
deallocate test_cur
go


--将机构号中存在小写的字母修改成大写
declare @ls_tablename varchar(50),@ls_sql varchar(500)
declare test_cur cursor for
SELECT pbc_tnam
        FROM pbcatcol 
        WHERE pbc_cnam = 'branch_no'
        ORDER BY pbc_tnam  
        for read only
open test_cur
fetch test_cur into @ls_tablename;
while @@fetch_Status = 0
begin
set @ls_sql='update' +'  '  +@ls_tablename+'   set branch_no=upper(branch_no)'
exec( @ls_sql)
fetch test_cur into @ls_tablename;
end
close test_cur
deallocate test_cur
go


--将会员卡号中存在小写的字母修改成大写
declare @ls_tablename varchar(50),@ls_sql varchar(500)
declare test_cur cursor for
SELECT pbc_tnam
        FROM pbcatcol 
        WHERE pbc_cnam = 'card_id'
        ORDER BY pbc_tnam  
        for read only
open test_cur
fetch test_cur into @ls_tablename;
while @@fetch_Status = 0
begin
set @ls_sql='update' +'  '  +@ls_tablename+'   set card_id=upper(card_id)'
exec( @ls_sql)
fetch test_cur into @ls_tablename;
end
close test_cur
deallocate test_cur
go
阅读更多
版权声明:本文仅供参考,如有疑问可联系【女程序员QQ630849360】 https://blog.csdn.net/xiongyongting/article/details/53993547
个人分类: 【数据库】SqlServer
上一篇【数据库SQL】将全角转换成半角
下一篇【数据库SQL】游标使用案例
想对作者说点什么? 我来说一句

没有更多推荐了,返回首页

关闭
关闭