Forum Discussion
Leul2020
Mar 03, 2020Copper Contributor
Dynamic Column add to table from other table columns and getting error what wrong i'm doing here
alter PROCEDURE [dbo].[INSERT_CERTIFICATE_FIELD] AS declare @ColumnName varchar(100) declare @field_List varchar(100) declare @getColumnName cursor declare @SQLFieldUpdate varchar(4000) decl...
Leul2020
Mar 03, 2020Copper Contributor
the field names are under " FIELD_NAME" in table "CERTIFICATE_FIELD"
select FIELD_NAME from CERTIFICATE_FIELD
we have anther table 'CERTIFICATE_DATA' where the new columns is created from CERTIFICATE_FIELD If NOT EXISTS
the error i get from the store_procedure is
error message
Msg 207, Level 16, State 1, Line 49
Invalid column name 'CERTIFICATE_DATA'.
Msg 207, Level 16, State 1, Line 49
Invalid column name 'FIELD1'.
Msg 207, Level 16, State 1, Line 49
Invalid column name 'CERTIFICATE_DATA'.
Msg 207, Level 16, State 1, Line 49
Invalid column name 'FIELD2'.
Msg 207, Level 16, State 1, Line 49
Invalid column name 'CERTIFICATE_DATA'.
Msg 207, Level 16, State 1, Line 49