Wrox Programmer Forums
|
SQL Server 2005 General discussion of SQL Server *2005* version only.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 1st, 2009, 03:12 AM
jomet
Guest
 
Posts: n/a
Default sp_adduser permission

Hi friends,

I have a query which is correctly working in sql 2000 generate permission error in sql2005

Query:

If not Exists (select * from sysusers where name='jometuser')
Begin
EXEC sp_adduser @loginame='jometuser',@name_in_db='jometuser'
EXEC sp_addrolemember N'db_datareader','jometuser'
EXEC sp_addrolemember N'db_datawriter','jometuser'
End
GO

I run this query logged as a user having permission 'db_owner'

SQL 2005 generates error:

Msg 15247, Level 16, State 1, Procedure sp_adduser, Line 35
User does not have permission to perform this action.

please help to identify the problem or suggest an alternative way to do the same.

Thanks,





Similar Threads
Thread Thread Starter Forum Replies Last Post
Permission Ruman29 Access 2 July 1st, 2006 07:09 AM
(0x800A0046) Permission denied,not IIS permission! David Hay Classic ASP Basics 3 April 30th, 2006 10:47 PM
You don't have permission lenbush329 Access 3 October 17th, 2005 09:48 AM
Permission denied tksarun Classic ASP Components 0 March 11th, 2005 03:01 AM
Permission Denied hamidmq Javascript How-To 2 March 10th, 2005 09:41 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.