Hi,
I am trying to update a column in a table based multiple columns of another table.
Below is the script that I am using:
UPDATE tblNews
SET N_PS_IDs =
(case isnull(InfraNewsMigration.dbo.thedatafile.Col027, '0')
when '1' then '11'
end) + ', ' +
(case isnull(InfraNewsMigration.dbo.thedatafile.Col028, '0')
when '1' then '12'
end) + ', ' +
(case isnull(InfraNewsMigration.dbo.thedatafile.Col029, '0')
when '1' then '9'
end) + ', ' +
(case isnull(InfraNewsMigration.dbo.thedatafile.Col036, '0')
when '1' then '14'
end)
FROM tblNews, InfraNewsMigration.dbo.thedatafile
WHERE tblNews.N_ID = InfraNewsMigration.dbo.thedatafile.[Col001]
This is not updating my column, any ideas where I am going wrong?
Thanks
Dabase
I am trying to update a column in a table based multiple columns of another table.
Below is the script that I am using:
UPDATE tblNews
SET N_PS_IDs =
(case isnull(InfraNewsMigration.dbo.thedatafile.Col027, '0')
when '1' then '11'
end) + ', ' +
(case isnull(InfraNewsMigration.dbo.thedatafile.Col028, '0')
when '1' then '12'
end) + ', ' +
(case isnull(InfraNewsMigration.dbo.thedatafile.Col029, '0')
when '1' then '9'
end) + ', ' +
(case isnull(InfraNewsMigration.dbo.thedatafile.Col036, '0')
when '1' then '14'
end)
FROM tblNews, InfraNewsMigration.dbo.thedatafile
WHERE tblNews.N_ID = InfraNewsMigration.dbo.thedatafile.[Col001]
This is not updating my column, any ideas where I am going wrong?
Thanks
Dabase