Follow along with the video below to see how to install our site as a web app on your home screen.
Note: This feature may not be available in some browsers.
-- 1. Insert the record(s) into new table
--- The example below assume that these two tables
--- have the exact same structure
INSERT INTO NewTable
SELECT * FROM OldTable WHERE .....
DELETE FROM OldTable WHERE .....
--- BOTH where clauses must be identical
SELECT * INTO NewTable FROM OldTable WHERE ....
IF OBJECT_ID('DataBaseName..NewTable') IS NULL
BEGIN
--- NewTable does not exists
SELECT * INTO NewTable FROM OldTable
WHERE ......
END
ELSE
BEGIN
--- NewTable already exists
INSERT INTO NewTable
SELECT * FROM OldTable WHERE .....
END
---- Delete the records
DELETE FROM OldTable WHERE .....