SQLTeam.com | Weblogs | Forums

Text field converting to Sci Notation


#1

I'm trying to create the following Update Query: [CODE]UPDATE Book1 INNER JOIN Products ON Book1.jhlkj = Products.Vendor_Item_Code SET Book1.asdfsda1 = [Products].[UPC];

[/CODE]

Basically, I'm looking to update the UPC codes in a table. When I do, my values over 12 characters, formatted as text, change to Scientific notation, even thought the field being update is also data type, TEXT. I have even tried to use a leading ' in front of the codes. It is not displaying as scientific notation, the actual value in the field shows as scientific notation. And of course, I'm losing a character which gets rounded.

What can I do to keep my formatting?


#2

The syntax does not appear to be valid for Microsoft SQL Server. Are you using SQL Server or another RDBMS? Assuming SQL Server, the update syntax would be this:

UPDATE b SET
	b.asdfsda1 = p.UPC
FROM
	Book1 b
	INNER JOIN Products p ON
		p.Vendor_Item_Code = jhlkj;

If you do that and if asdfsda1 column in the table Book1 is TEXT and the UPC column in Products table is TEXT, there should not be any rounding.