Generate update statements to update data in specified fields of table TableName
The database object to generate the script against
The name of the table to create
Generate SET clauses for these fields/columns
Generare WHERE clause for these key columns
A full SQL WHERE and/or ORDER BY clause restricting or ordering the dataset used to generate the UPDATE statements
Debug.Print CreateUpdateStatement("tblKeyNames", "KeyValDesc,KeyValDescShort", "KeyName,KeyVal", "WHERE keyname='ReconStatusStr'")
returning three rows as an INSERT statements ...
UPDATE tblKeyNames SET KeyValDesc='Unmatched',KeyValDescShort='Unmatched'
WHERE KeyName='ReconStatusStr' AND KeyVal='U'
UPDATE tblKeyNames SET KeyValDesc='Partially Matched',KeyValDescShort='Partial'
WHERE KeyName='ReconStatusStr' AND KeyVal='P'
UPDATE tblKeyNames SET KeyValDesc='Matched',KeyValDescShort='Matched'
WHERE KeyName='ReconStatusStr' AND KeyVal='M'