I have a lookup table with id(primary key), name, value and branchId as the columns. Currently I have a set of data with the branchId being the same for the entire records. I need to duplicate the data with same values for the name and value columns, but a different value of branchId in the same table.
Any help with the query/script to achieve this would be appreciated.
Thanks in advance!
If
idis anIDENTITY, its values will be produced automatically:For a set of branchID values, you can
CROSSjoin to an existing a table (or create one on the fly):