0

I have imported a data set from a .csv file into SQL Server using the DTS import wizard. All the data imported is in VARCHAR data type in the SQL Server table.

I need the columns containing money values (now in the varchar data type columns in the table) to CONVERT or CAST to money or decimal data types for use in queries with the SUM function. The CONVERT and CAST functions will not allow a varchar to change to a money, integer or decimal.

DTS will not import an integer, decimal or money value from a .csv file. So I am stuck with a table that has my money data stored as a varchar data type that I cannot cast or convert. I am really perplexed by this.

Does anybody have any ideas? Thanks

marc_s
  • 732,580
  • 175
  • 1,330
  • 1,459
  • You can't you convert? Are you getting an error? I think the best thing is for you to implement the changes you want right in the Import Wizard (You have that option in the import wizard) – Renato Afonso Sep 25 '17 at 15:13
  • What error are you getting? What version of SQL Server? `DECLARE @money AS varchar(255) = '18.21'; SELECT @money, cast(@money AS money)` works fine – SQLBadPanda Sep 25 '17 at 15:20

0 Answers0