Question
Hi, everyone. I need a help for SQL stored procedure. I have two tables, which table (A) which have Columns called Category, Code and Description
Hi, everyone.
I need a help for SQL stored procedure.
I have two tables, which table (A) which have Columns called Category, Code and Description and a table (B) which have columns called Reason and ReasonDescription.
in table (A) on column Code I have a DATA on each row such as 101 and in column Description, has data which describe each data from Column Code such as in the first row in column Code has value 101 then in column Description have data 'hello world' and in second row column Code has value 102, Description have data 'Hello Hello'. AND, in Table (B), on column Reasons, I have a value which is coming from Table (A) Column Code and each Value separated by ( | ) SUCH AS 102|103|101 or 101|201 or 101 and so on, and i want to have a DATA from table (A) column Description into column ReseanDescription in table (B), can anybody help for this, please?
and this is my code and the error I am getting.
select * from A left join B on A.Reasons = B.Code and B.Category=500 where Reasons is not null
Msg 245, Level 16, State 1, Line 1
Conversion failed when converting the varchar value '202 |' to data typesmallint.
Best Regards
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started