Hi,
You can write a stored procedure for inserting a record into a database.
Call the following function in order to check the 10 digit number in the membership table.
e.g.
- Create Function CheckId(@MainId varchar)
-
returns int
-
as
-
Begin
-
Declare @v_subId varchar(3);
-
Declare @v_Id varchar(3);
-
-
--Get SubId from main Id.Here you will get first 3 characters of the string.
-
Select @v_subId =Substring(@MainId,1,3)
-
-
--check that if above Id exists in the communitytable
-
Select @v_Id = Id from communitytable Where Id is like @v_subId
-
If @v_newId Is Not NULL
-
BEGIN
-
Return 1
-
END
-
ELSE
-
BEGIN
-
Return 0
-
END
-
-
-
End