Welcome
Guest
, you are in:
<root>
•
Login
devio dbscript ScrewTurn Wiki
Navigation
¶
Main Page
Random Page
Create a new Page
All Pages
Categories
Navigation Paths
Administration
File Management
Create Account
Search the wiki
»
Back
dbo ufnLeadingZeros (function)
Modified on 2011/08/27 11:16
by
wikibot
Categorized as
Uncategorized
== wikibot == {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" |- valign="top" | '''Function''' | dbo.ufnLeadingZeros |- valign="top" | '''Description''' | Scalar function used by the Sales.Customer table to help set the account number. |} === Source === {{{{<nowiki> CREATE FUNCTION [dbo].[ufnLeadingZeros]( @Value int ) RETURNS varchar(8) WITH SCHEMABINDING AS BEGIN DECLARE @ReturnValue varchar(8); SET @ReturnValue = CONVERT(varchar(8), @Value); SET @ReturnValue = REPLICATE('0', 8 - DATALENGTH(@ReturnValue)) + @ReturnValue; RETURN (@ReturnValue); END; </nowiki>}}}}
ScrewTurn Wiki
version 3.0.1.400. Some of the icons created by
FamFamFam
.