Last post Mar 13, 2015 02:00 AM by A.suresh
Mar 13, 2015 12:51 AM|RickyEternus|LINK
I want to insert a record, but before inserting record to table it should check that the value which we are inserting is already exists or not. if not insert the record. Column is not a primary key
For example cityname is a column of city table, before inserting cityname into the cityname cloumn, it should check. what will be the sqlserver query.
Thanks in advance!
Mar 13, 2015 02:00 AM|A.suresh|LINK
IF NOT EXISTS(SELECT * FROM citytable WHERE cityname='your newly inserting cityname')