A simple insert into select from.
CREATE TABLE dbo.TEST
(
item_id INT NOT NULL
, barcode VARCHAR (20) NULL
, sale_price DECIMAL (14, 2) NULL
, description VARCHAR (100) NULL
, PRIMARY KEY (item_id)
)
CREATE TABLE dbo.TEST_COPY
(
item_id INT NOT NULL
, barcode VARCHAR (20) NULL
, sale_price DECIMAL (14, 2) NULL
, description VARCHAR (100) NULL
, PRIMARY KEY (item_id)
)
INSERT INTO TEST_COPY (item_id, barcode, sale_price, description) SELECT item_id, '9999' as barcode, sale_price, description FROM TEST WHERE item_id = 9
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…