Checking if New or Not?
-
I want to insert one value to sql database table. when inserted, I want to check if this value is already stored in database table. if the present value is already in database, I want to show message box or something notification to user. if the present value is new one, it will be inserted to database. So, how to check for this condition? I want to check the present inserting value against all inserted value in database.
-
I want to insert one value to sql database table. when inserted, I want to check if this value is already stored in database table. if the present value is already in database, I want to show message box or something notification to user. if the present value is new one, it will be inserted to database. So, how to check for this condition? I want to check the present inserting value against all inserted value in database.
If Not Existes(Select fieldname From tablename Where fieldname=yourvale)
Begin
--data NOT exists
End
Else
Begin
--data ALREADY exists
Endhope this will help
Regards... Vijay Jain :)
"One thing you can't recycle is wasted time."