DECLARE @counter tinyint
DECLARE @nextChar char(1)
DECLARE @sendepin tinyint=10
DECLARE @sLength tinyint = 10
DECLARE @reqepin tinyint = 10
DECLARE @randomString1 varchar(50)='yogesh'
SET @counter = 1
SET @randomString1 = ''
SET @sendepin=1
WHILE @sendepin <= @reqepin
BEGIN
SET @randomString1=''
SET @counter=1
WHILE @counter <= @sLength
BEGIN
SELECT @nextChar = CHAR(ROUND(RAND() * 93 + 33, 0))
IF ASCII(@nextChar) not in (34, 39, 40, 41, 44, 46, 96, 58, 59)
BEGIN
SELECT @randomString1 = @randomString1 + @nextChar
END
SET @counter = @counter + 1
END
SELECT @randomString1
SET @sendepin=@sendepin+1
END
KiaranNafade
Member
136 Points
59 Posts
Stored Procedure Error
Dec 29, 2012 10:33 AM|LINK
DECLARE @counter tinyint
DECLARE @nextChar char(1)
DECLARE @sendepin tinyint
DECLARE @sLength tinyint = 10
DECLARE @reqepin tinyint = 10
DECLARE @randomString varchar(50)
SET @counter = 1
SET @randomString = ''
SET @sendepin=1
WHILE @sendepin <= @reqepin
BEGIN
WHILE @counter <= @sLength
BEGIN
SELECT @nextChar = CHAR(ROUND(RAND() * 93 + 33, 0))
IF ASCII(@nextChar) not in (34, 39, 40, 41, 44, 46, 96, 58, 59)
BEGIN
SELECT @randomString = @randomString + @nextChar
SET @counter = @counter + 1
END
END
insert into dbo.epincode values(@randomString)
SET @sendepin=@sendepin+1
END
yrb.yogi
Star
14460 Points
2402 Posts
Re: Stored Procedure Error
Dec 29, 2012 12:12 PM|LINK
.Net All About