Discover innovative solutions, best practices, and cutting-edge technologies in enterprise architecture
Tuesday, July 14, 2009
Split value function SQL SERVER
Friday, July 3, 2009
Fetch Numer/AlphaNumeric value from Varchar table's Field In SQL SERVER
Following function keeps only numeric characters in string and removes all the other
character from the string. This is very handy function.
Create FUNCTION dbo.GetNumberFromVarcharField ( @string VARCHAR(max) -- varchar field value ) RETURNS VARCHAR(max) AS BEGIN DECLARE @IncorrectCharLoc SMALLINT SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string) WHILE @IncorrectCharLoc > 0 BEGIN SET @string = STUFF(@string, @IncorrectCharLoc,1, '') SET @IncorrectCharLoc = PATINDEX('%[^0-9]%', @string) END SET @string = @string RETURN @string END --- test SELECT dbo.GetNumberFromVarcharField('sadas????ASDa######10')
Following function keeps only Alphanumeric characters in string and removes all
the other character from the string. This is very handy function too.
CREATE FUNCTION dbo.GetAlphaNumericString ( @string VARCHAR(8000) ) RETURNS VARCHAR(8000) AS BEGIN DECLARE @IncorrectCharLoc SMALLINT SET @IncorrectCharLoc = PATINDEX('%[^0-9A-Za-z]%',@string) WHILE @IncorrectCharLoc > 0 BEGIN SET @string = STUFF(@string, @IncorrectCharLoc,1, '') SET @IncorrectCharLoc = PATINDEX('%[^0-9A-Za-z]%', @string) END SET @string = @string RETURN @string END GO -- Test SELECT dbo.GetAlphaNumericString('ABC”_I+{D[]}4|:e;””5,<.F>/?6')
Wednesday, July 1, 2009
True Random and Unique AlphaNumeric Number Generator
Forums for Microsoft .NET developers
Hi begginers to Microsoft.NET world, here a list of forums and educational sites where you can post your queries and get ur answers from professionals. this may help you to increase your knowledge and also help if u stuck with some issues…become a regular member(its free) so that source code access is easy ….and also contibute wen u have enough greymatter to solve complex issues of .NET. Comment on this post and add more forums which i might have missed …..
www.w3schools.com