Solved

please verify sql syntax to add user to db

Posted on 2007-03-27
4
251 Views
Last Modified: 2008-02-01
From the master database:

CREATE LOGIN MSProjectServerUser
WITH
    PASSWORD = 'password',    
    DEFAULT_DATABASE = Projectserver

sp_addsrvrolemember 'MSProjectServerRole', 'MSProjectServerUser'

In the ProjectServer database:

CREATE USER MSProjectServer for Login MSProjectServerUser

sp_addrolemember 'MSProjectRole', 'MSProjectServer'
0
Comment
Question by:gianitoo
  • 2
4 Comments
 
LVL 39

Expert Comment

by:appari
ID: 18805367
seems to be OK,
are you getting some error? what's the problem?
0
 
LVL 50

Expert Comment

by:Lowfatspread
ID: 18805778
do you want to specify the default schema as well?
0
 
LVL 1

Author Comment

by:gianitoo
ID: 18807591
i get this
Msg 102, Level 15, State 1, Line 6
Incorrect syntax near 'sp_addsrvrolemember'.
0
 
LVL 39

Accepted Solution

by:
appari earned 500 total points
ID: 18808378
try seperating the sql statements with  go keyword in between

CREATE LOGIN MSProjectServerUser
WITH
    PASSWORD = 'password',    
    DEFAULT_DATABASE = Projectserver
GO
sp_addsrvrolemember 'MSProjectServerRole', 'MSProjectServerUser'
GO
In the ProjectServer database:

CREATE USER MSProjectServer for Login MSProjectServerUser
GO
sp_addrolemember 'MSProjectRole', 'MSProjectServer'
 
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQL Server agent & maintenance task issue ? 8 55
sql help 5 49
Pivot Query Problem 9 31
Restrict result set 1 0
by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

743 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now