RODBC and Microsoft SQL Server: Truncating Long Character Strings

后端 未结 2 1507
轮回少年
轮回少年 2021-01-18 00:49

I am trying to query a variable from a Microsoft SQL Server database using R/RODBC. RODBC is truncating the character string at 8000 characters.

Original code: trun

2条回答
  •  梦毁少年i
    2021-01-18 01:30

    Maybe this has changed recently, but with the following query format getting varchar(MAX) fields longer then 8000 character can be queried from SQL Server into R

    query_string <- "SELECT CAST(text_var AS text) AS text_var FROM table_name"
    

提交回复
热议问题