Saturday, May 18, 2019

MS SQL Server -How to remove leading zero from a number.

Cast the number as int.

select cast (columnsWithLeadingZeros as int) from yourTable

No comments:

Post a Comment

Recently Executed queries

 SELECT     txt.TEXT AS [SQL Statement],     qs.EXECUTION_COUNT [No. Times Executed],     qs.LAST_EXECUTION_TIME AS [Last Time Executed],   ...