How to find out the size of data type in sql. For example if i have declared a variable or column as
declare @test varchar(255)
Then i need the size of the variable data type @test to be shown as 255.
EDIT:Now, I know how to get it for the column, is there any way for variable?
You can use sql_variant_property.