I'm creating a sproc that will insert rows into a 'staging' table with an insert into + subquery like so:
INSERT INTO myStagingTable
SELECT col1, col2, col3
FROM myRealTable
I need to put a conditional in there somehow to determine if the value from col1 for example already exists on myStagingTable, then don't insert it, just skip that row from myRealTable.
is this possible? If so, how would I structure that?
TIA