record exist or not

Check Record Exists or not in SQL server

A record exists or not is always be a question for developers, Some of the tables like user registration or other tables, we don’t want to insert any duplicate value. First, we have to check the record is exists or not.

We always want to insert a is unique value into the table.

In this blog i will explain you, how can you check already exist record in table.

It’s very easy to check existing record in table.

Below code will help you to check record exist or not.

If EXISTS ( SELECT group_name FROM demo WHERE id= ” id”)

             BEGIN

             SELECT 'Record EXIST'"

              END

              ELSE

             BEGIN

             INSERT INTO demo (name,address) values('abc','xyz')

              END

Here the table name is demo and there is three fields id,name and address.

This code will help you to restrict duplicate value in table.

I hope this blog is helpful for you, If you like this blog and helpful for you, then don’t forget to share it, This can help others who are facing the problem like this.

admin Administrator
Hi, this is Brijesh Vishwakarma I am a web developer, at the part-time I write blogs, I like to write the blog and I want to share my knowledge. Mostly I write the blog about Blogging, Online earning, Seo, Website, Domain, and Hosting. Be happy
follow me
×
admin Administrator
Hi, this is Brijesh Vishwakarma I am a web developer, at the part-time I write blogs, I like to write the blog and I want to share my knowledge. Mostly I write the blog about Blogging, Online earning, Seo, Website, Domain, and Hosting. Be happy
Latest Posts
  • whatsapp pay
  • insert update delete in asp.net
  • record exist or not
  • free software download

Leave a Comment