本文介绍了使用STR()将数字转换为字符串时如何保存初始零点的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

很抱歉提出一个愚蠢的问题,但是我尝试了很多方法,它们确实工作了



当我尝试转换STR(06)时如何保存初始零点进入

SQL语句中的字符串?

总是给我6而不是06.


非常感谢。

Sorry to raise a stupid question but I tried many methods which did
work.
how can I conserve the initial zero when I try to convert STR(06) into
string in SQL statment?
It always gives me 6 instead of 06.

Thanks a lot.

推荐答案







只要你在数据库交易中工作就应该有学会了

你永远不要说永远。


至少有一个明显的例子,输出的格式必须是

SQL:在标准查询工具中完成显示时,可以像查询分析器一样使用
。对于管理员来说通常就是这种情况。

-

Erland Sommarskog,SQL Server MVP,


SQL Server 2005联机丛书


SQL Server 2000联机丛书



Working so long as you have done in the database trade should have learnt
you to never say never.

There is at least one obvious case where formatting of output must be
done in SQL: to wit when the display is done in a standard query tool
like Query Analyzer. Which typically is the case for admin stuff.
--
Erland Sommarskog, SQL Server MVP, es****@sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pro...ads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodinf...ons/books.mspx


这篇关于使用STR()将数字转换为字符串时如何保存初始零点的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

11-02 22:52