SQL Server Performance
  1. arkiboys Member

    I know how to create a login using sp_addlogin
    Using sql, how do you check if the login already exists and if it does not then use sp_addlogin to create it?
  2. Adriaan New Member

    Use on of the security functions. In SQL 2000, only this one applies to logins:
    IF SUSER_SID('login') IS NULL
    EXEC sp_addlogin ..................

Share This Page