Take the 2-minute tour ×
Database Administrators Stack Exchange is a question and answer site for database professionals who wish to improve their database skills and learn from others in the community. It's 100% free, no registration required.

We just set up a new SQL Server 2008 database, and I got the link set up between our server and an iSeries As400 server that we get some of our data from.

The problem I'm having is that it is rounding down any floating numbers, which is a pain because we're working with dollar amounts a lot of the time.

select * FROM openquery(NADS, 'select CMD, 1.23 Type from CREDD')

On our older server this returns the CMD column, and a column called Type with 1.23 all the way down. On the new server type is just 1.00

So far as I can tell, the link part is set up the same. The IBM i Access for Windows ODBC Setup is mostly the same, but there are some differences between versions that I'm not sure about.

Edit: In case it matters, For the provider I'm using Microsoft OLE DB Provider for ODBC Drivers

Edit2:

provider options are the same
provider options are the same

Linked Server properties: enter image description here

iSeries Access for windows ODBC setup appears to be the same enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here enter image description here

share|improve this question
    
What is the data type on each side? –  Mike Walsh Nov 13 '13 at 20:44
    
I'm not sure what it is on the iSeries side. I'm assuming some kind of float. I'm just doing a select * on my side, so unless openquery is converting the data it should be the same... –  AndyD273 Nov 13 '13 at 20:50
    
It is rare to see Float used in an IBM i database. We generally use fixed point (packed) Decimal or (zoned) Numeric. Occasionally you might see some size Int, but float is very rare. Our systems tend to be used for business applications where exact numbers are preferred. –  WarrenT Nov 13 '13 at 23:05
    
You might try IBM Data Studio to look at the table definition. SYSCOLUMNS would be the catalog view to look in. –  WarrenT Nov 13 '13 at 23:07
    
As you said, the new server is working differently from the old server. So what is different on your new server? –  WarrenT Nov 14 '13 at 3:33

1 Answer 1

Figured it out!!

Apparently we didn't have the latest service pack installed. We had to install the 64bit version of the service pack (32bit version failed to install), and when it finished the decimal numbers were coming across.

EDIT: In case anyone was wondering:
We're using "IBM iAccess for Windows 7.1 (07.01.0800) (64bit)" and using "Microsoft OLE DB Provider for ODBC Drivers" as the linked server sql driver.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.