Difference between revisions of "Dbo.ufnLeadingZeros (function)"
(New page: == wikibot == {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" |- | '''function | dbo.ufnLeadingZeros |- |} <pre> CREATE FUNCTION [dbo].[ufnLeadingZeros]( ...) |
|||
| (6 intermediate revisions by the same user not shown) | |||
| Line 1: | Line 1: | ||
== wikibot == | == 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 === | ||
| + | <pre> | ||
| + | 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; | ||
| + | </pre> | ||
| + | |||
| + | |||
| + | == automatically generated == | ||
{| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | {| border="1" cellpadding="5" cellspacing="0" style="border-collapse:collapse" | ||
| Line 5: | Line 35: | ||
| '''function | | '''function | ||
| dbo.ufnLeadingZeros | | dbo.ufnLeadingZeros | ||
| + | |- valign="top" | ||
| + | | '''Description | ||
| + | | Scalar function used by the Sales.Customer table to help set the account number. | ||
|- | |- | ||
|} | |} | ||
<pre> | <pre> | ||
| + | |||
CREATE FUNCTION [dbo].[ufnLeadingZeros]( | CREATE FUNCTION [dbo].[ufnLeadingZeros]( | ||
@Value int | @Value int | ||
Latest revision as of 22:59, 23 June 2010
wikibot[edit]
| Function | dbo.ufnLeadingZeros |
| Description | Scalar function used by the Sales.Customer table to help set the account number. |
Source[edit]
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;
automatically generated[edit]
| function | dbo.ufnLeadingZeros |
| Description | Scalar function used by the Sales.Customer table to help set the account number. |
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;