By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,474 Members | 1,267 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,474 IT Pros & Developers. It's quick & easy.

Zerofill

P: 95
Hi frnds, I want to know that zerofill is a valid function in SQL or not....
Feb 17 '08 #1
Share this Question
Share on Google+
1 Reply


ck9663
Expert 2.5K+
P: 2,878
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
Feb 18 '08 #2

Post your reply

Sign in to post your reply or Sign up for a free account.