Solved

please verify sql syntax to add user to db

Posted on 2007-03-27
4
274 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
How to "ASSIGN" a RecordID based on 1st character of a Field? 8 37
T-SQL to Update Table Dynamically 2 48
sql query help 2 53
Help with SQL - TOP 10 by date and by group 13 40
Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

803 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