Jwalin Khatri

Archive for March 2009

http://interviews.dotnetthread.com/2009/02/making-gridview-rows-or-individual.html

Function to Add Leading 0’s (Zeros)

Posted by: jwalin on: March 5, 2009

 Thankx to By Joshua A. WalkerTESTING: 
SELECT dbo.DBA_fnAddLeadingZeros(2457,6)
Result: ‘002457”
***************************************************************************/
CREATE FUNCTION [dbo].[DBA_fnAddLeadingZeros](@Int INT, @TotalLength INT)
RETURNS VARCHAR(2000)
AS
BEGIN
     DECLARE @Return VARCHAR(2000)
/************************************************************************
        –IF @TotalLength > 100 SELECT @TotalLength = 100
      SELECT @Return = replicate(‘0′,@TotalLength) + CAST(@Int AS VARCHAR)
      RETURN RIGHT(@Return,@TotalLength)
 END
Happy Programming !!!!

 If you want to delete all the records from the all the tables in database you might consider Delete Or Trancate command as both delete all the records from the tables. However it depends on ‘Constraint’ and delete records from one table at a time. But here is the code which delete the records from [...]


Blog Stats

  • 14,744 hits

  • jwalin: Follow the following steps 1]. open you Page in NOTEPAD. 2]. find the tag 3]. Replace the "body" like body oncontextmenu=”return false;" 4]. Sav
  • cytocine: Halu , how to put that , i mean where to put the part ?? i really dont know i hope you can help me out thanks..
  • elmerdolor: Halu , how to put that , i mean where to put the part ?? i really dont know i hope you can help me out thanks..