Solved

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

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

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

In database programming, custom sort order seems to be necessary quite often, at least in my experience and time here at EE. Within the realm of custom sorting is the sorting of numbers and text independently (i.e., treating the numbers as number…
As they say in love and is true in SQL: you can sum some Data some of the time, but you can't always aggregate all Data all the time! Introduction: By the end of this Article it is my intention to bring the meaning and value of the above quote to…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

757 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

22 Experts available now in Live!

Get 1:1 Help Now