0

I am importing an Excel sheet to SQL, and it is getting stored in table1. I am then copying the data from table1 to table2 with the below query:

insert into table1(JOB_ID ,JOB_NAME)
select isnull(JOB_ID,'') ,isnull(JOB_NAME,'') from table2$

But my requirement is, when it's getting imported from Excel to SQL table the datatype of JOB_ID is automatically gone to Float.So when am copying that data into another table the values in table2-JOB_ID are in float.but i need it in string or varchar .

9
  • Doesn't Convert.ToString() do the job? Commented Jun 27, 2013 at 17:18
  • importing using the import wizard? Commented Jun 27, 2013 at 17:19
  • 2
    How are mysql and sql-server both tagged in this question? Commented Jun 27, 2013 at 17:24
  • 1
    import wizard allows for variable changes to import values under the edit mappings button and you can map columns to new types Commented Jun 27, 2013 at 17:29
  • 1
    @DavidScott - make this an answer so the OP can give you credit for the answer. Commented Jun 27, 2013 at 17:41

1 Answer 1

1

import wizard allows for variable changes to import values under the edit mappings button and you can map columns to new types

Hope this helps

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.