How can I maintain the same column format in R data frame as in my SQL table?

StackOverflow https://stackoverflow.com/questions/21263024

  •  30-09-2022
  •  | 
  •  

Вопрос

I have a user id number in my data base that is made of 17 characters. When I fetch the table with RODBC I get the number in a scientific number format. How can I maintain the same format as in my SQL table?

I use MSSQL, R 3.0.2, RODBC as a connector.

Thanks.

Это было полезно?

Решение

In your call to sqlFetch or sqlQuery, pass as.is = TRUE to retrieve everything as character vectors. Then you can manually convert any other columns as you need.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top