更新客户ID号码 [英] update customer id numbers

查看:89
本文介绍了更新客户ID号码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个表格,其中包含5-8个字符的客户ID号码。它们需要使用前导M更新为10个字符并用零填充。我是新手,非常感谢你的帮助。

I have a table that contains customer Id numbers that are 5-8 characters. They need to be updated to 10 characters with a leading M and padded with zeros. I am new to this and would appreciate assistance.

推荐答案

''M''+复制('''',9-len (cast(id as varchar(10))))+ cast(id as varchar(10))


感谢束兔看起来很完美。如何仅在我的数据库中在customerID字段上运行该操作。我可以简单地将脚本放入企业管理器的编辑步骤字段中吗?
Thanks bunch Rabbit that looks like it is perfect. How can I make that run on the customerID field only in my database. Can I simply put the script into the edit steps field in Enterprise Manager?


我不确定企业管理器是什么。我通常使用SQL Server Management Studio。您只需在更新查询中使用它。
I''m not sure what the Enterprise Manager is. I normally use the SQL Server Management Studio. You would just use that in an update query.
展开 | 选择 | Wrap | 行号


这篇关于更新客户ID号码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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