Solved

importing numbers from access into sql with different format

Posted on 2011-03-09
4
306 Views
Last Modified: 2012-06-22
I am importing a column from access to sql 2005 but the numbers in the column are formatted differently:  e.g.
2000
0.50
2.8
22.55
I would like all to have decimal 2 places.  the sql column is money format.  thanks
0
Comment
Question by:bar0822
4 Comments
 
LVL 38

Accepted Solution

by:
Aaron Tomosky earned 84 total points
ID: 35090715
You can make the column a decimal(18,2) format or you can just cast it when you use it.
Select cast(numbercolumn as decimal(18,2)) from table

If you do that you could store it as a varchar or whatever.
0
 
LVL 9

Assisted Solution

by:kaminda
kaminda earned 83 total points
ID: 35091117
I would suggest you to import data to SQL Server's varchar column with the required length. And then covert it to money within SQL Server by casting it. This way you wont loose any data due to formating (At least it is minimal)
0
 
LVL 49

Assisted Solution

by:Gustav Brock
Gustav Brock earned 83 total points
ID: 35093276
Leave the numbers "as is" and format them to your liking when displayed.

/gustav
0
 

Author Comment

by:bar0822
ID: 35097666
I imported as is and imported into money column and now have 4 zeros after decimal point but will leave as is unless they want it changed.  I'll use a cast in select.  thanks for the replies.

0

Featured Post

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

JSON is being used more and more, besides XML, and you surely wanted to parse the data out into SQL instead of doing it in some Javascript. The below function in SQL Server can do the job for you, returning a quick table with the parsed data.
Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
With Microsoft Access, learn how to specify relationships between tables and set various options on the relationship. Add the tables: Create the relationship: Decide if you’re going to set referential integrity: Decide if you want cascade upda…
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

895 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

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now