Solved

How to append records from one table to another with different data types for 1 field ?

Posted on 2007-04-02
1
201 Views
Last Modified: 2010-05-18
I am creating an Access application with Access as the front end and SQL Server as the back end database.

I have an existing table named tblA with 3 fields as follows:

field1 defined as int 4, Identity field
field2 defined as type float(8)
field3 defined as type nvarchar(10).

I have another table named table tblB with 2 fields as follows:
field2 defined as type nvarchar(9)
field3 defined as type nvarchar(10).

I want to append the records from table tblA into table tblB.
Do you know how I could accomplish this ?
0
Comment
Question by:zimmer9
[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
1 Comment
 
LVL 11

Accepted Solution

by:
dready earned 500 total points
ID: 18840727
Can you give some example data for both tables? Do you want to put the float values from tblA.field2 in tblB.field2, but then as nvarchar? IF this is the case, you could do the follwing:

INSERT INTO tblB(field2, field3)
SELECT cast(field2 as nvarchar(9)), field3 from tblA

0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Confronted with some SQL you don't know can be a daunting task. It can be even more daunting if that SQL carries some of the old secret codes used in the Ye Olde query syntax, such as: (+)     as used in Oracle;     *=     =*    as used in Sybase …
It is possible to export the data of a SQL Table in SSMS and generate INSERT statements. It's neatly tucked away in the generate scripts option of a database.
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

628 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