Checking Duplicate values in Database
-
I wrote a query for getting some values from database , and and bind it to grid. Now i want to add new values, but before that i wanna check whether there are entries of the same values... How can I do this...? a friend suggested to add some conditions to the same stored proc to get this done.. Please help me...?
SAJAN A PILLAI C#.NET Programmer TELESOFT INDIA PVT LTD... BANGALORE "Winners don't do different things. They do things differently. ...
-
I wrote a query for getting some values from database , and and bind it to grid. Now i want to add new values, but before that i wanna check whether there are entries of the same values... How can I do this...? a friend suggested to add some conditions to the same stored proc to get this done.. Please help me...?
SAJAN A PILLAI C#.NET Programmer TELESOFT INDIA PVT LTD... BANGALORE "Winners don't do different things. They do things differently. ...
Do a select to check if the duplicate criteria is there and then insert if nothing matches. You could do this with an IF NOT EXISTS query. Alternatively, create a unique index on these fields and rely on the database catching it.
Deja View - the feeling that you've seen this post before.
-
I wrote a query for getting some values from database , and and bind it to grid. Now i want to add new values, but before that i wanna check whether there are entries of the same values... How can I do this...? a friend suggested to add some conditions to the same stored proc to get this done.. Please help me...?
SAJAN A PILLAI C#.NET Programmer TELESOFT INDIA PVT LTD... BANGALORE "Winners don't do different things. They do things differently. ...
Are u checking for duplicate values in a Database or a table? If it is a table the you use the following script. SELECT count(Column(s)) FROM table_Name ORDER BY Column(s) GROUP BY column(s) HAVING Count(Column(s)) > 1 Hope this helps.
Skan If you knew it would not compile why didn't you tell me?!?!?!