Browse by Tags

All Tags » column length (RSS)

Maximum length of each column

How do I find out the maximum length of each column in a table? Here is the answer declare @sql varchar ( 8000 ), @table sysname select @table = 'your_table' , @sql = '' select @sql = @sql + 'select ''' + @table + '''...

Column length and Data length

When you use character datatypes(char,varchar,nchar,etc), always make sure that column has enough length to have data. Otherwise sometimes you would get errors and sometimes you wont. Consider the following example Declare @t table ( i int , test_col...
Posted by Madhivanan | with no comments