[dba-SQLServer] Convert nvarchar to money

Stoker, Kenneth E Kenneth.Stoker at pnl.gov
Wed Feb 25 12:23:35 CST 2004


This should work.  You might have to specify the size, which is 8 bytes,
and/or the precision and scale, which are 19 and 4.

INSERT INTO Table2
SELECT AcctNum, CONVERT(money, Amount)
FROM Table1

Ken Stoker
Technology Commercialization
Information Systems Administrator
PH: (509) 375-3758
FAX: (509) 375-6731
E-mail:  Kenneth.Stoker at pnl.gov 


-----Original Message-----
From: Mark Boyd [mailto:MarkBoyd at McBeeAssociates.com] 
Sent: Wednesday, February 25, 2004 10:11 AM
To: SQLServerList
Subject: [dba-SQLServer] Convert nvarchar to money


I am trying to append data from Table1 to Table2.

In Table1, the field [Amount] is datatype 'nvarchar'.

In Table2, the field [Amount] is datatype 'money'.

 

I am using the following SQL query to run the append: "INSERT INTO
Table2 SELECT AcctNum, Amount FROM Table1".

I guess I need to use the CONVERT function, but can't figure out how
this is done.

Any examples would be greatly appreciated.

 

Thanks,

Mark Boyd

Sr. Systems Analyst

McBee Associates, Inc.

 

_______________________________________________
dba-SQLServer mailing list
dba-SQLServer at databaseadvisors.com
http://databaseadvisors.com/mailman/listinfo/dba-sqlserver
http://www.databaseadvisors.com




More information about the dba-SQLServer mailing list