Data type size of variable in sql

前端 未结 1 910
离开以前
离开以前 2021-01-20 04:57

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 nee

1条回答
  •  萌比男神i
    2021-01-20 05:31

    You can use sql_variant_property.

    declare @test varchar(255)
    set @test = '' --Must assign a value
    select sql_variant_property(@test, 'MaxLength')
    

    0 讨论(0)
提交回复
热议问题