Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2005 Forums
 Transact-SQL (2005)
 Maximum data length used in column?

Author  Topic 

OldMySQLUser
Constraint Violating Yak Guru

301 Posts

Posted - 2008-02-09 : 04:28:09
How can I find the maximum length of data in a given table column please?
So, of a column is designed as nvarchar(255),but the longest row entered is only 80 characters, how can I ascertain that?

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2008-02-09 : 04:44:39
Select Max(DATALENGTH(col)) FROM Table

Damian
"A foolish consistency is the hobgoblin of little minds." - Emerson
Go to Top of Page
   

- Advertisement -