Access to SQL - data differences when importing?

J

Jason

I recently used an append query in access to bring data from a linked
spreadsheet into a linked SQL table. I brought in about 15 fields and all
imported as expected except for one. This one is a numeric field with a 1-5
digit number in it. The numbers that appear in the SQL table now are correct
in that the numbers are the same as they should be. The difference is in how
they display when I view the table in SSMS. The pre-existing numbers in the
table (which were added by a 3rd party program which is the primary interface
to this DB) are formatted differently than the ones I imported. The existing
ones are all centered in the column whereas the ones I imported are all
left-justified.

I'm not sure this makes any difference as the "new" numbers are read just
fine by the 3rd party application but I am curious as to why they display
differently. I'm just wondering if I should have done something different and
if I have a ticking time bomb on my hands?

Thanks in advance!
 
J

Jeff Boyce

Jason

Just out of curiosity, are those "five digit numbers" zip codes? Since you
will never need to add/subtract/multiply/divide zip codes (or at least, I
hope you don't!), they are not really "numbers", they are text/char.

What is the data type into which they are stored? Access (?and SQL-Server)
might display actually numbers justified one way and text another...

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jason

I found a stored procedure in the DB which somewhat answers my question. It
looks like application is calling this SP when they add numbers to this
field. The SP seems to add cell padding so the toal length equals 30. I am a
little confused though as to why this is necessary and how I would accomplish
it with my append query.
 
J

Jeff Boyce

Jason

In the end, will it really matter? Could you use a query to strip off all
the extra padding (see Trim() function) and compare values AFTER the
in-query data cleanup?

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jason

As to whether or not it will matter, I don't know;hence the question in the
first place. I am really asking if I should be concerned about padding the
entries I put in. I am somewhat new to DB work and don't know all of the
reasons that padding may be necessary.

No, these are not zip codes although I still don't foresee any mathematic
operations being performed on them. The program that normally writes to this
field does pad the entries up to 30 characters for some reason. Would it have
anything to do with the way reports generated from this data get formatted?
 
J

Jeff Boyce

Insufficient information to tell.

Access can store just the 5 characters, then use a query to "pad", if
necessary.

Regards

Jeff Boyce
Microsoft Office/Access MVP
 
J

Jason

If the information was insufficient, you might have told me what I needed to
provide. Its amazing to me that people read and answer these message boards
with the seemingly sole purpose to be arrogant and not actually answer
questions. I guess it pumps up egos to make others feel stupid. If you don't
want to help thats fine, just dont answer.
 
J

Jeff Boyce

Jason

If I don't understand your situation, how do you expect me to know what to
ask about?

If my response came across "arrogant", I apologize.

.... and I still don't understand your specific situation well enough to
offer specific suggestions.

Good luck!

Regards

Jeff Boyce
Microsoft Office/Access MVP

P.S. attributing nasty intent to folks who volunteer their time to help out
is unlikely to encourage other folks to offer their ideas
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top