Data type variable size in sql
1 answer
You can use sql_variant_property .
declare @test varchar(255)
set @test = '' --Must assign a value
select sql_variant_property(@test, 'MaxLength')
+6
source to share