[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-03-20
2
Medium Priority
?
747 Views
Last Modified: 2011-04-14
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.
0
Comment
Question by:maidinhtai
2 Comments
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 1000 total points
ID: 16236759
Hi maidinhtai,
maidinhtai,
> sp_droplogin 'user1' --(1)

Put an exec before this sp call
exec sp_droplogin 'user1' --(1)

Cheers!
0
 
LVL 3

Author Comment

by:maidinhtai
ID: 16237335
Thanks. I always forget 'exec' :D
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Recently we ran in to an issue while running some SQL jobs where we were trying to process the cubes.  We got an error saying failure stating 'NT SERVICE\SQLSERVERAGENT does not have access to Analysis Services. So this is a way to automate that wit…
Microsoft Access has a limit of 255 columns in a single table; SQL Server allows tables with over 255 columns, but reading that data is not necessarily simple.  The final solution for this task involved creating a custom text parser and then reading…
Via a live example, show how to shrink a transaction log file down to a reasonable size.
Viewers will learn how to use the UPDATE and DELETE statements to change or remove existing data from their tables. Make a table: Update a specific column given a specific row using the UPDATE statement: Remove a set of values using the DELETE s…
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question