order by LEN(value), value
Not perfect, but works well in a lot of cases.
More Related Contents:
- SQL Server GUID sort algorithm. Why?
- What is the best way to create and populate a numbers table?
- How do I fix the error ‘Named Pipes Provider, error 40 – Could not open a connection to’ SQL Server’?
- How to get Time from DateTime format in SQL?
- SQL Server IN vs. EXISTS Performance
- How much size “Null” value takes in SQL Server
- SQL Server Pivot Table with multiple column aggregates
- PIVOT in sql 2005
- What is the maximum characters for the NVARCHAR(MAX)? [duplicate]
- Using a sort order column in a database table
- Atomic UPSERT in SQL Server 2005
- SQL Server sp_msforeachtable usage to select only those tables which meet some condition
- Is it possible to force row level locking in SQL Server?
- SQL Server ORDER BY date and nulls last
- SQL Server – Dynamic PIVOT Table – SQL Injection
- How to remove accents and all chars a..z in sql-server?
- Find non-ASCII characters in varchar columns using SQL Server
- How to query values from xml nodes?
- How to query for Xml values and attributes from table in SQL Server?
- Unable to begin a distributed transaction
- Violation of UNIQUE KEY constraint on INSERT WHERE COUNT(*) = 0 on SQL Server 2005
- What happens to the primary key Id when it goes over the limit?
- What is the point of “Initial Catalog” in a SQL Server connection string?
- How do you kill all current connections to a SQL Server 2005 database?
- Milliseconds wrong when converting from XML to SQL Server datetime
- Why is casting from float to varchar being rounded in SQL Server?
- “Prevent saving changes that require the table to be re-created” negative effects
- Convert UTC Milliseconds to DATETIME in SQL server
- Table Valued Function Killing My Query Performance
- @@ERROR and/or TRY – CATCH