Actually the question should be more structured but i think i understand what you trying to explain to some extent. It's like you don't want duplicate values in that column [R_NAME]. What i will suggest is.
1. Create a Uniques constraint on that column [R_NAME] and use your code to catch any error thrown when user enters a value already existing.
2. Use a stored procedure as follows
Create Procedure Pr_DDetails
(
@No nvarchar(20), @r_name nvarchar(256)
)
As
Begin
declare @rname nvarchar(256),
select @rname = R_NAME from [TableName] where R_NAME = @rname
if(@rname IS NULL)
return
Else
Insert Into [TableName] (NO, R_NAME) Values(@No, @r_name)
End
Let me know if you understand it as intended.