?
Solved

please verify sql syntax to add user to db

Posted on 2007-03-27
4
Medium Priority
?
301 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

Technology Partners: 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

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…
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 video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …

770 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