Forgive my code, I'm still learning.
I want to make several select statements and paste them into one temporary table. For each select statement, I would like some kind of identification to know from which selection statement the data comes from.
The following is an unobvious idea to use the case example below.
Error:
Msg 8152, Level 16, State 14, Line 14
String or binary data will be truncated.
the code:
if object_id('tempdb..
drop table
SELECT
Case
When TranID = TranID then 'BK Problem'
Else 'Error' End as 'Test'
INTO
FROM
WHERE TypeID = 't'
INSERT INTO
SELECT
Case
When TranID = TranID then 'CCA Problem'
Else 'Error' End as 'Test'
FROM
WHERE TypeID = 'r'
I appreciate any help pointing me in the right direction.
thank
Nlub source
share