Having trouble with insert query on linked server Two servers. Server A and Server B both has database named KPS. KPS has two tables complaint and attachment. KPS database on server A gets the value from the Web. 

Both table if the submitted value = 1 then run the insert query which will insert the col1,col2 and col3 from Server A KPS to Server B KPS. They both are linked server. Both table attachment and complaint submit value needs to be 1 if it is 0 then do not insert. There will be two insert query one for complaint and one for attachment. 

Can i also check that i m not inserting same data over and over ?

Thank you..
So I assume that you already have the queries to insert the data. So the question is really &quot;Can I also check that I m not inserting the same data over and over again?&quot;.
There are a couple of ways you can do this. One simple way is to create a constraint on the columns in your table. Let's assume that they are col1,col2 and col3. So you could create a unique constraint on the table like this:
ALTER TABLE table_name 
ADD CONSTRAINT Constraint_Name unique(col1,col2,col3) 

A composite primary key will also achieve this, but you may already be using the  primary key in a different column.