Solved

please verify sql syntax to add user to db

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

Migrating Your Company's PCs

To keep pace with competitors, businesses must keep employees productive, and that means providing them with the latest technology. This document provides the tips and tricks you need to help you migrate an outdated PC fleet to new desktops, laptops, and tablets.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
CREATE DATABASE ENCRYPTION KEY 1 82
Are triggers slow? 7 28
SQL parsing XML works but want to do it another way 4 47
Applying Roles in Common Scenarios 3 43
This article will describe one method to parse a delimited string into a table of data.   Why would I do that you ask?  Let's say that you need to pass multiple parameters into a stored procedure to search for.  For our sake, we'll say that we wa…
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…

734 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