Link to home
Start Free TrialLog in
Avatar of maidinhtai
maidinhtai

asked on

Msg 102, Level 15, State 1, Line 2 Incorrect syntax near 'sp_droplogin'.

if exists (select * from sys.syslogins where Name = 'user1')
      sp_droplogin 'user1' --(1)
CREATE LOGIN [user1] WITH PASSWORD= '', CHECK_EXPIRATION=OFF, CHECK_POLICY=OFF --(2)
When I press the execute button of SQL server management studio, I receive the error.
ASKER CERTIFIED SOLUTION
Avatar of Aneesh
Aneesh
Flag of Canada image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of maidinhtai
maidinhtai

ASKER

Thanks. I always forget 'exec' :D