Let's say I have this table :
CREATE TABLE [dbo].[finaleTable](
[VENDId] [bigint] NOT NULL,
[companyName] [nvarchar](4) NULL,
----Others field
CONSTRAINT [PK_MyTable] PRIMARY KEY CLUSTERED ([VENDId])
) ON [PRIMARY]
GO
And this query :
INSERT INTO dbo.finaleTable
SELECT *
FROM Tmp1
Before inserting data into the table i have to check the integrity constraint on these 2 fields. If the values exist then move to the next line of data taken from table TMP1. if they do not exist then insert the line.
Could you suggest how can i progress to do this?