sql - Insert new user into DB -
i'm trying insert new user database if user's id not exist.
i can't seem figure out.
the data given user_id, password. want insert data database if user_id not exist.
how?
if answer isn't self-explanatory, please explain going on.
all want able insert new customer database customers w3schools if there isn't duplicate.
assuming you're using sql server, can add select statement verify if user exists before proceeding;
if not exists (select loginname master.dbo.syslogins name = @loginname , dbname = 'your_db_name') begin -- insert statement here end
Comments
Post a Comment