[2 days left] What’s wrong with your cloud strategy? Learn why multicloud solutions matter with Nimble Storage.Register Now

x
?
Solved

Convert Integer into a fix  Char column

Posted on 2006-06-18
3
Medium Priority
?
325 Views
Last Modified: 2010-03-19
Dear Experts,

How can I convert an Integer Column into a fix Char Column like as follows:

Integer Column                         Char (7) Column
7    -----                                   0000007
8                                             0000008
9                                             0000009
10                                           0000010
100                                         0000100
1000                                       0001000

Any lead will be greatly apprciated.

Thanks.


0
Comment
Question by:JaimeJegonia
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 900 total points
ID: 16931535
SELECT RIGHT('0000000'+CAST(urIntColumn as varchar),7)
0
 

Author Comment

by:JaimeJegonia
ID: 16931581
That's right. I've been trying to settle it using Char(7) and LEFT function.

Thanks you saved me hours.
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 16931590
thanks for Grade 'B'
0

Featured Post

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article we will learn how to fix  “Cannot install SQL Server 2014 Service Pack 2: Unable to install windows installer msi file” error ?
This month, Experts Exchange sat down with resident SQL expert, Jim Horn, for an in-depth look into the makings of a successful career in SQL.
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.
Viewers will learn how the fundamental information of how to create a table.

649 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question