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
 General SQL Server Forums
 New to SQL Server Programming
 question

Author  Topic 

Trininole
Yak Posting Veteran

83 Posts

Posted - 2011-05-10 : 10:20:30
what is the syntax for seeking all the different lengths of a field in a table? For example, the field stateID, what syntax would i use to find all the different lengths of the field like if Stateid has 2 characters like "01" or three characters like "435" or five characters like "56789". What syntax would i use to see how many different lengths the field contains?

Roger DeFour

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-05-10 : 10:21:57
SELECT DISTINCT LEN(StateID) FROM myTable
Go to Top of Page
   

- Advertisement -