Set up register table for email and MemberID

  • My asp.net program will create a user register page. I want user using email to login and make both email and MemberID (from external source) as unique column.

    How to set both [Email] and [MemberID] column to void adding duplicate record?

    If I set both columns as unique column, do I need to code in program, or SQL will send an error to program if user input a duplicate record?

  • CREATE TABLE Example

    (

    MemberID varchar(50) NOT NULL,

    Email varchar(50) NOT NULL,

    UNIQUE (MemberID, Email)

    )

    SQL server will generate an error message but it won't be a particularly friendly message. How to handle error messages in asp.net generated by SQL server is a bit out of scope for this forum. You probably want to check for an existing record and notify the end user but this is really beyond my expertise.

Viewing 2 posts - 1 through 1 (of 1 total)

You must be logged in to reply to this topic. Login to reply