admin管理员组文章数量:1316974
I migrated a database to an Azure SQL Server Managed Instance.
When I try to do a SELECT
on a specific column, I get this error:
Invalid Field Size
The column is defined as VARCHAR(MAX)
.
I get no error if:
- I query Azure SQL Server MI via SSMS (20.2)
- I query the old on premise database via SSMS (20.2)
- I query the old on premise database via ODBC Driver 17 for SQL Server
- I query the old on premise database via SQL Server Native Client 11.0 (v. 2011.11)
Any of the ODBC driver with Azure end up errorring out for that specific column.
The ODBC drivers are 32 bit. Application using them need it like that.
I migrated a database to an Azure SQL Server Managed Instance.
When I try to do a SELECT
on a specific column, I get this error:
Invalid Field Size
The column is defined as VARCHAR(MAX)
.
I get no error if:
- I query Azure SQL Server MI via SSMS (20.2)
- I query the old on premise database via SSMS (20.2)
- I query the old on premise database via ODBC Driver 17 for SQL Server
- I query the old on premise database via SQL Server Native Client 11.0 (v. 2011.11)
Any of the ODBC driver with Azure end up errorring out for that specific column.
The ODBC drivers are 32 bit. Application using them need it like that.
Share Improve this question edited Jan 29 at 21:02 marc_s 756k184 gold badges1.4k silver badges1.5k bronze badges asked Jan 29 at 20:35 JcHamJcHam 1 1- have you tried with latest driver? – Pratik Lad Commented Feb 3 at 10:10
1 Answer
Reset to default 0To resolve this Use ODBC Driver 18 for SQL Server (latest version) and update your connection string or else try 64 bit driver. 32-bit drivers are restricted in how much data they can handle at once because of memory addressing limits
If the VARCHAR(MAX) column is not truly required to store large text, consider altering the column to a VARCHAR(n) type where n is the maximum length.
ALTER TABLE your_table
ALTER COLUMN your_column VARCHAR(4000);
本文标签:
版权声明:本文标题:azure sql managed instance - Getting Invalid Field Size error using ODBC for column of datatype varchar(max) - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741998081a2410452.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论