In this case it can be done as its just string manipulation. Main challenge is the conversion of text to ascii code and back. SQL 2008 has following functions that can convert character to equivalent ascii code
MSDN: ASCII (Transact-SQL)
MSDN: CHAR (Transact-SQL)
You can use the guts of this snippet to create the stored procedure
DECLARE @input VARCHAR(50)
DECLARE @output VARCHAR(50)
DECLARE @length INT
DECLARE @i INT
DECLARE @tmp INT
DECLARE @num2 INT
SET @input = 'pass'
SELECT @output = '', @i = 1, @num2=1, @length = LEN(@input)
WHILE @i <= @length
BEGIN
SET @tmp = ascii(SUBSTRING(@input,@i,1))
SET @tmp = @tmp + (@i*@num2)
SET @num2 = @num2 * -1
SET @output = @output + char(@tmp)
SET @i = @i+1
end
SELECT @output
if you need to know how to create a stored procedure you can look at this:
CREATE PROCEDURE (Transact-SQL)