[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

How do I add a 0 to the end of a value in a field?

Posted on 2005-05-11
7
Medium Priority
?
247 Views
Last Modified: 2011-09-20
I have a field (int), and I would like to add a zero to every value in that field?  How could I do this update.  What would the qry look like?
0
Comment
Question by:indy500fan
  • 2
  • 2
  • 2
  • +1
7 Comments
 
LVL 28

Expert Comment

by:rafrancisco
ID: 13980897
UPDATE YourTable
SET YourColumn = 0
0
 
LVL 1

Accepted Solution

by:
Don Smith earned 2000 total points
ID: 13980898
Why not just multiply it by ten?

e.g. update mytable set fld1 = fld1 * 10
0
 
LVL 28

Expert Comment

by:rafrancisco
ID: 13980904
or

UPDATE YourTable
SET YourColumn = YourColumn * 10
0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 6

Expert Comment

by:PePi
ID: 13980914
by adding a zero do you mean 1 + 0 = 1 or 1 add 0 = 10?

if the former:

    Update yourTable SET
        field = field + 0

if the latter:

    Update yourTable SET
        field = field * 10
0
 
LVL 6

Expert Comment

by:PePi
ID: 13980922
doh! ra quick on the draw! ;)
0
 

Author Comment

by:indy500fan
ID: 13981077
I mean, I have the integer 40423434 and I want it to be changed to 404234340

Does that make sense?  I think that smithsys has it.  If you multiplied 40423434 by 10, you would get 40423434, thereby updating the value.

Thanks!

Eric
0
 

Author Comment

by:indy500fan
ID: 13981292
Thanks for all your help.  Wow you guys under the DB forum are FAST!!!!
0

Featured Post

Granular recovery for Microsoft Exchange

With Veeam Explorer for Microsoft Exchange you can choose the Exchange Servers and restore points you’re interested in, and Veeam Explorer will present the contents of those mailbox stores for browsing, searching and exporting.

Question has a verified solution.

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

Ready to get certified? Check out some courses that help you prepare for third-party exams.
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.
Via a live example, show how to setup several different housekeeping processes for a SQL Server.
Suggested Courses

829 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