i have a #table as follows
CREATE TABLE #ReportingNumbe rs
(
HeadID INT,
EntityID INT,
Type VARCHAR(10),
Value DECIMAL(30,12)
)
a master table as follows
CREATE TABLE HeadIDFieldMapp ing
(
HeadID INT,
FieldName VARCHAR(100)
)
and one transaction table (vData) which have columns as all rows of table HeadIDFieldMapp ing i.e.table vData is having FieldName which are rows(value of fieldName) in table HeadIDFieldMapp ing . table #ReportingNumbe rs has field HeadID and table HeadIDFieldMapp ing has field HeadID.
now i want to update field Value of #ReportingNumbe rs Table with the value of fields of vData table using dynamic query. how can be this done?
CREATE TABLE #ReportingNumbe rs
(
HeadID INT,
EntityID INT,
Type VARCHAR(10),
Value DECIMAL(30,12)
)
a master table as follows
CREATE TABLE HeadIDFieldMapp ing
(
HeadID INT,
FieldName VARCHAR(100)
)
and one transaction table (vData) which have columns as all rows of table HeadIDFieldMapp ing i.e.table vData is having FieldName which are rows(value of fieldName) in table HeadIDFieldMapp ing . table #ReportingNumbe rs has field HeadID and table HeadIDFieldMapp ing has field HeadID.
now i want to update field Value of #ReportingNumbe rs Table with the value of fields of vData table using dynamic query. how can be this done?