Oct 29, 2011
Sql Function for padding text to field output
create function ULPAD(@vInput varchar(max), @iLenght smallint,@cPadChar char(1))
returns varchar(max)
as
begin
if @vInput is not null
begin
if LEN(@vInput) <= @iLenght
begin
set @vInput = RIGHT (REPLICATE(@cPadChar, @iLenght)+ CAST (@vInput AS varchar), @iLenght)
end
end
return @vInput
end
Ex:
SELECT @NewEmpNo =dbo.ULPAD((Select com_empsrno +1 from Mcompany where com_code=@Emp_Org_srno) , 5,'0')
Subscribe to:
Post Comments (Atom)
-
Remarks This property specifies the appearance of the embedded Windows Media Player. When uiMode is set to "none", "mini...
-
<body> <form id="form1" runat="server"> <img class="RibbonL" src="Imag...
-
Partial Class Default Inherits System.Web.UI.Page Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Lo...
What is the use of n-tier architecture and 3-tier architecture?
how to implement 3-tier architecture in asp.net using c#. 3-Tier architecture is also called layered architecture. Some people called it ...
No comments:
Post a Comment