Re: Please Help
From: David Lucus (davidl@studentlife.tamu.edu)
Date: 01/13/03
- Next message: Magnus Pettersson: "Re: Application roles Please Help!"
- Previous message: Aaron Bertrand [MVP]: "Re: Please Help"
- In reply to: Aaron Bertrand [MVP]: "Re: Please Help"
- Next in thread: Sue Hoegemeier: "Re: Please Help"
- Reply: Sue Hoegemeier: "Re: Please Help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
From: "David Lucus" <davidl@studentlife.tamu.edu> Date: Mon, 13 Jan 2003 16:07:25 -0600
It is now giving me another error. It is telling me that I cannot use the
"USE" command in a procedure or trigger. This is in a stored procedure. if
you have any other ideas I would be much appreciative.
thx,
David
"Aaron Bertrand [MVP]" <aaron@TRASHaspfaq.com> wrote in message
news:OyzSx10uCHA.1848@TK2MSFTNGP09...
> Try issuing a USE command before executing, and not specifying the
database
> name in the EXEC call, like so:
>
> USE MASTER
> EXEC sp_addlogin @newname
>
> USE DBName
> EXEC sp_grantdbaccess @newname
> EXEC sp_addrolemember @sturolename, @newname
>
> --
> Aaron Bertrand, SQL Server MVP
> http://www.aspfaq.com/
>
> Please reply in the newsgroups, but if you absolutely
> must reply via e-mail, please take out the TRASH.
>
>
> "David Lucus" <davidl@studentlife.tamu.edu> wrote in message
> news:etA5uu0uCHA.2512@TK2MSFTNGP11...
> > I have a stored procedure that adds new sql server accounts from the
web.
> > there are 2 databases that need teh login. The database where the
stored
> > procedure resides has no problems granting roles and db access
> permissions,
> > however when i try to give it permissions to the other database nothing
is
> > happening. It is not adding a user to the roles or throwing an error.
> here
> > is the code i am using to add the user to the second db
> >
> > EXECUTE DBName.dbo.sp_grantdbaccess @newname
> >
> > EXECUTE DBName.dbo.sp_addrolemember @sturolename, @newname
> >
> > where @newname is the variable with the name, and @sturolename is the
role
> > name.
> >
> > if anyone has any ideas please help.
> >
> > thx,
> > David
> >
> >
>
>
- Next message: Magnus Pettersson: "Re: Application roles Please Help!"
- Previous message: Aaron Bertrand [MVP]: "Re: Please Help"
- In reply to: Aaron Bertrand [MVP]: "Re: Please Help"
- Next in thread: Sue Hoegemeier: "Re: Please Help"
- Reply: Sue Hoegemeier: "Re: Please Help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ] [ attachment ]
Relevant Pages
|