Connecting Tech Pros Worldwide Forums | Help | Site Map

Zerofill

Member
 
Join Date: Jul 2006
Location: Faridababd
Posts: 95
#1: Feb 17 '08
Hi frnds, I want to know that zerofill is a valid function in SQL or not....

ck9663's Avatar
Expert
 
Join Date: Jun 2007
Posts: 1,925
#2: Feb 18 '08

re: Zerofill


I think that's a MySQL function. If that's a function that left-pad the value with '0', you can still re-create it in sql-server. Something like:

Expand|Select|Wrap|Line Numbers
  1. SELECT right('0000000000' + rtrim(ltrim(cast(@myInt as varchar(10))),10)
  2.  
-- CK
Reply


Similar Microsoft SQL Server bytes