Click here to Skip to main content
15,913,145 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
Hi
I have textbox data which am inserting the data into sqlserver.

eg:txtbox.Text="Dotnet Framework";

For checking whether "Dotnet Framework " existed or not with the below query and it works fine
SQL
ALTER PROCEDURE [dbo].[spCheckDuplicateName]
(@CheckValue varchar(100),
@ReturnValue int out)
AS
SET NOCOUNT ON
BEGIN
IF Exists (SELECT TOP 1 Name From tblName WHERE Name = @CheckValue)
set @ReturnValue = 3;
Else
SET @ReturnValue=0; 
END


but if enter again string as"DotnetFrameWork", it considering it as new name and inserting,which i dont want to insert it.

You may feel its a silly question to ask but i couldn't do it.

Any idea to achieve this.So that i can't inserting same name with out space.
Posted

1 solution

You might want to check out SOUNDEX and DIFFERENCE. They go further than just spaces but could be a good check to filter out similar entries.

http://technet.microsoft.com/en-us/library/ms189282%28v=sql.105%29.aspx[^]

Good luck!
 
Share this answer
 
Comments
Thanks7872 12-Nov-13 3:48am    
+5 !

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900