Quantcast
Channel: Forum Getting started with SQL Server
Viewing all articles
Browse latest Browse all 7129

Simple coding question! - copying fields from table to table with different length

$
0
0

Hi - im sure this is a really easy thing to do; im a SQL newbie!

I have a small SQL express database for about 1500 records, spread across a number of tables. I want to simply copy the entry in one table to another. The format of the fields is slightly different, just by length 100 characters vs 50.

I had found the UPDATE solution, where the table to be updated is dbo.customer, and the source table is dbo.custom. I ran the following:

UPDATE

dbo.CUSTOMER


SET

dbo.CUSTOMER.emailhome=dbo.CUSTOM.text7


FROM

dbo.CUSTOM

It seemed to run with no errors but there is no data copied. Can anyone help?? I think it might be something to do with the length of the strings but there is no error message. For reference its the emailhome field that is 100 characters and the text7 is 50.

Im very grateful in advance,

Scott


Just a plain old end user


Viewing all articles
Browse latest Browse all 7129

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>