---
title: "how to check which record does not exists in one table to another table in sql server?"  
description: "how to check which record does not exists in one table to another table in sql server?"  
author: "Aditya Patel"  
published: 2018-05-19  
updated: 2018-05-19  
canonical: https://answers.mindstick.com/qa/42604/how-to-check-which-record-does-not-exists-in-one-table-to-another-table-in-sql-server  
category: "technology"  
tags: ["sql programming"]  
reading_time: 1 minute  

---

# how to check which record does not exists in one table to another table in sql server?

how to [check](https://answers.mindstick.com/qa/50789/how-to-fix-an-iphone-7-ios-update-error-on-unable-to-check-for-update) which record does not [exists](https://www.mindstick.com/forum/158947/how-do-you-use-the-exists-operator-to-check-for-the-existence-of-records-in-a-subquery) in [one table](https://www.mindstick.com/forum/156825/how-data-can-be-copied-from-one-table-to-another-table) to another [table in sql](https://www.mindstick.com/forum/205/find-the-all-column-with-schema-for-any-table-in-sql-server) [server](https://www.mindstick.com/articles/710/apache-server-installation-on-windows)?

for example we have two table like table1 and table2 . i want to [select](https://www.mindstick.com/forum/156648/select-any-element-and-change-its-property-via-nth-child-selector) all table1 record which does not exists in table2.

## Answers

### Answer by Arti Mishra

Use **not exists keyword** to select first [table](https://www.mindstick.com/articles/43918/how-to-design-table-using-bootstrap) record which does not exist in the second table.

**Here, is the Query string****\** SELECT t1.name FROMtable1 t1WHERE NOT EXISTS (SELECT * FROM table2 t2WHERE t2.id = t1.id) \


---

Original Source: https://answers.mindstick.com/qa/42604/how-to-check-which-record-does-not-exists-in-one-table-to-another-table-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
