Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

please verify sql syntax to add user to db

Posted on 2007-03-27
4
Medium Priority
?
306 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Get your Conversational Ransomware Defense e‑book

This e-book gives you an insight into the ransomware threat and reviews the fundamentals of top-notch ransomware preparedness and recovery. To help you protect yourself and your organization. The initial infection may be inevitable, so the best protection is to be fully prepared.

Question has a verified solution.

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

I've encountered valid database schemas that do not have a primary key.  For example, I use LogParser from Microsoft to push IIS logs into a SQL database table for processing and analysis.  However, occasionally due to user error or a scheduled task…
In this article we will get to know that how can we recover deleted data if it happens accidently. We really can recover deleted rows if we know the time when data is deleted by using the transaction log.
In this video, Percona Director of Solution Engineering Jon Tobin discusses the function and features of Percona Server for MongoDB. How Percona can help Percona can help you determine if Percona Server for MongoDB is the right solution for …
Are you ready to place your question in front of subject-matter experts for more timely responses? With the release of Priority Question, Premium Members, Team Accounts and Qualified Experts can now identify the emergent level of their issue, signal…

604 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