INSERT INTO ... SELECT ... CASE Problem

Last Post 23 Jan 2008 06:18 AM by kjmcsd. 1 Replies.
AddThis - Bookmarking and Sharing Button Printer Friendly
  •  
  •  
  •  
  •  
  •  
Sort:
PrevPrev NextNext
You are not authorized to post a reply.
Author Messages
kjmcsd
New Member
New Member

--
23 Jan 2008 05:40 AM
I have the following SQL:

A short version

INSERT INTO Table A
SELECT CASE Response
WHEN 0 THEN 'N'
ELSE Response
END
FROM Table B

Response is a tinyint field in Table A
Response is a char(1) field in Table B

I get a conversion error when I run the SQL:

"Conversion failed when converting varchar to 'N' to data type tinyint"

How do I fix this?
kjmcsd
New Member
New Member

--
23 Jan 2008 06:18 AM
Thanks! That worked.
You are not authorized to post a reply.

Acceptable Use Policy