How do I perform a check using CASE to check if a specific column has been reached then SELECT INTO INSERT into a another table while copying the current data over into this second table?
This is because my first tbl cases only accepts inserts upto column 20 (in the real world these are actually upload files).
The two by definition are exactly the same as I populated the second from a Select Table As > Script into > New table query ....etc. ID is in both are identity cols.
For example:
--INSERT THE SAME DATA BUT DO NOT INSERT INTO COLUMN UploadNo1 to UploadNo20 into casesTwo as this should already have data (files from table cases).
INSERT INTO casesTwo --ONLY FILE FROM COLUMN UploadNo20 SELECT CAST( CASE WHEN No20 = 'UploadNo20' THEN 1 ELSE 0 END) FROM cases