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)
-
Bootstrap css front-end framework. jQuery fast, small, and feature-rich JavaScript library. DataTables advanced interaction contro...
-
<body> <form id="form1" runat="server"> <img class="RibbonL" src="Imag...
-
<script language="JavaScript"> javascript:window.history.forward(1); </script>
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