Search code examples
sql-servervarchar

How rigid is the max size of a VARCHAR in SQL Server?


i.e. if I create a VARCHAR(50) field, what happens if I try to assign it a value that's 100 characters long?

Will SQL Server let me do this? Is it somehow less efficient?


Solution

  • Will SQL Server let me do this? Is it somehow less efficient?

    It will emit an error, saying that the string or binary data would be truncated.