Okay, I’m getting this error when I try to execute this procedure. The thing is I’m not trying to convert to a bit at any time. At least not on purpose. I’m a bit stumped at the moment.
Declare @AValue varchar(max)
set @AValue = (SELECT Value
FROM dbo.Tbl
WHERE Name=@FILE
AND Value LIKE (CAST(@MODID as varchar(15))+'|%'))
set @AValue = PARSENAME(REPLACE(@AValue, '|', '.'), 1) -- Hack way to parse.
INSERT INTO dbo.Tbl
(
Name,
Value,
Type,
CDT,
UDT,
Active,
User
)
VALUES
(
'Agreement',
(CAST(@MODID AS varchar(15)) + '|' + @AValue),
'Download',
GETDATE(),
GETDATE(),
1,
@USER
)
Sorry, found the answer. I came back today and the error I was getting was completely different than the one I had when I first asked the question. Sorry I forgot to write that error.
Problem was my WHERE clause was getting multiple returns from the database cause I had been testing a lot, so there were duplicate rows.