One way to do it would be write a stored procedure that takes user ID as parameter and checks to see if its in the database.
Here is a sample
CREATE PROCEDURE usp_CheckUserExists
@UserID INT
AS
BEGIN
DECLARE @UserExists BIT
IF EXISTS(SELECT 1 FROM [Your User Table] WHERE UserID = @UserID)
BEGIN
SET @UserExists = 1
END
ELSE
BEGIN
SET @UserExists = 0
END
SELECT @UserExists AS UserExists
END
The SP returns true or false based on whether the user ID exists or not. You can take this result in your application to check if the user ID exists before creating the user.