An Apache Spark-based analytics platform optimized for Azure.
Hello @Tarapareddy,Saikrishna ,
Thanks for the question and using MS Q&A platform.
An important point to keep in consideration, we can use string length up to varchar(8000) only as this is the maximum number of characters that SQL varchar(n) data type can hold. So in cases when there are chances that the string length of the varchar column might exceed 8000 bytes, using varchar(8001) or anything higher will result into an error -
com.microsoft.sqlserver.jdbc.SQLServerException: The size (32672) given to the column 'PARAM_VALUE' exceeds the maximum allowed for any data type (8000).
If you use char or varchar, we recommend to:
- Use char when the sizes of the column data entries are consistent.
- Use varchar when the sizes of the column data entries vary considerably.
- Use varchar(max) when the sizes of the column data entries vary considerably, and the string length might exceed 8,000 bytes.
For more details, refer to Data Types and char and varchar
Hope this will help. Please let us know if any further queries.
------------------------------
- Please don't forget to click on
or upvote
button whenever the information provided helps you. Original posters help the community find answers faster by identifying the correct answer. Here is how - Want a reminder to come back and check responses? Here is how to subscribe to a notification
- If you are interested in joining the VM program and help shape the future of Q&A: Here is how you can be part of Q&A Volunteer Moderators