Solved

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

Posted on 2007-04-02
1
198 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
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

If you find yourself in this situation “I have used SELECT DISTINCT but I’m getting duplicates” then I'm sorry to say you are using the wrong SQL technique as it only does one thing which is: produces whole rows that are unique. If the results you a…
Composite queries are used to retrieve the results from joining multiple queries after applying any filters. UNION, INTERSECT, MINUS, and UNION ALL are some of the operators used to get certain desired results.​
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

685 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