Showing posts with label execute. Show all posts
Showing posts with label execute. Show all posts

Sunday, March 25, 2012

db_owner member execute problems

I've made a user a member of the db_owner role of a particular database.
However, this account does not have permission to execute a stored procedure
and I can't figure out why. The error message is shown below...
Server: Msg 15247, Level 16, State 1, Procedure sp_addmessage, Line 19
User does not have permission to perform this action.
Any help appreciated
Regards
PaulOnly members of the sysadmin or serveradmin server roles can
execute sp_addmessage.
-Sue
On Fri, 15 Jul 2005 10:25:30 +0100, "Paul Hatcher"
<paul.hatcher@.online.nospam> wrote:

>I've made a user a member of the db_owner role of a particular database.
>However, this account does not have permission to execute a stored procedur
e
>and I can't figure out why. The error message is shown below...
>Server: Msg 15247, Level 16, State 1, Procedure sp_addmessage, Line 19
>User does not have permission to perform this action.
>Any help appreciated
>Regards
>Paul
>|||Sue
Thanks for that - I was misreading the message as a lack of ability to run
the sp - I forgot that I was creating a custom message inside it!
Regards
Paul
"Sue Hoegemeier" <Sue_H@.nomail.please> wrote in message
news:voafd15qnose10e9dvdlrobdt9ohmh4s8p@.
4ax.com...
> Only members of the sysadmin or serveradmin server roles can
> execute sp_addmessage.
> -Sue
> On Fri, 15 Jul 2005 10:25:30 +0100, "Paul Hatcher"
> <paul.hatcher@.online.nospam> wrote:
>
>

DB_E_ERRORSINCOMMAND ( HRESULT = -2147217900 )

Hai all,

I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
recordset or execute query in VC++. But when I run the same query in
Query Analyzer, it is working fine. I am sure the connection string is
correct. I am running a collection of queries and finally commit the
transaction, but everytime it not throwing the exception on same query,

eachtime different queries throw exception randomly.

Can anyone tell whats the problem?
Urgent, Please help...
Looking forward for the response..
Thanx in advance...Prince (princevictor.moses@.gmail.com) writes:
> I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
> recordset or execute query in VC++. But when I run the same query in
> Query Analyzer, it is working fine. I am sure the connection string is
> correct. I am running a collection of queries and finally commit the
> transaction, but everytime it not throwing the exception on same query,
> eachtime different queries throw exception randomly.

It's more likely that there is some error in the calling sequence, rahter
than the SQL code. Without seeing your code, it's impossible to be more
detailed.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx|||Hi,

Thanx for ur reply..
Is there is any prob in the following query?

INSERT INTO jobhistory(schObjId, BaseLineId, ActionTaken, UserId,
historyDateTime, remarks) VALUES ('_2036', '', 'CREATED', 'Guest',
getDate(), 'Job Created by Guest -- Guest')

looking forward for the response...|||Prince (princevictor.moses@.gmail.com) writes:
> Thanx for ur reply..
> Is there is any prob in the following query?
> INSERT INTO jobhistory(schObjId, BaseLineId, ActionTaken, UserId,
> historyDateTime, remarks) VALUES ('_2036', '', 'CREATED', 'Guest',
> getDate(), 'Job Created by Guest -- Guest')
> looking forward for the response...

If it wasn't clear: I believe the problem is in the C++ code and the call
to ADO, not in the SQL itself.

But let's make a shot in the dark: att SET NOCOUNT ON.

--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se

Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

DB_E_ERRORSINCOMMAND ( HRESULT = -2147217900 )

Hai all,
I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
recordset or execute query in VC++. But when I run the same query in
Query Analyzer, it is working fine. I am sure the connection string is
correct. I am running a collection of queries and finally commit the
transaction, but everytime it not throwing the exception on same query,
eachtime different queries throw exception randomly.
Can anyone tell whats the problem?
Urgent, Please help...
Looking forward for the response..
Thanx in advance...Vodafone (princevictor.moses@.gmail.com) writes:
> I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
> recordset or execute query in VC++. But when I run the same query in
> Query Analyzer, it is working fine. I am sure the connection string is
> correct. I am running a collection of queries and finally commit the
> transaction, but everytime it not throwing the exception on same query,
> eachtime different queries throw exception randomly.
There is answer in comp.databases.ms-sqlserver. Please do not post the
same question independently to several newsgroups.
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server 2005 at
http://www.microsoft.com/technet/pr...oads/books.mspx
Books Online for SQL Server 2000 at
http://www.microsoft.com/sql/prodin...ions/books.mspx

DB_E_ERRORSINCOMMAND ( HRESULT = -2147217900 )

Hai all,
I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
recordset or execute query in VC++. But when I run the same query in
Query Analyzer, it is working fine. I am sure the connection string is
correct. I am running a collection of queries and finally commit the
transaction, but everytime it not throwing the exception on same query,
eachtime different queries throw exception randomly.
Can anyone tell whats the problem?
Urgent, Please help...
Looking forward for the response..
Thanx in advance...
Hi
Have you printed out the SQL Statement before you send it to the server? You
may want to use SQL Profiler to see what/if anything is being sent to the
server.
Have you also checked out
http://support.microsoft.com/default...b;en-us;18189?
John
"Prince" wrote:

> Hai all,
> I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
> recordset or execute query in VC++. But when I run the same query in
> Query Analyzer, it is working fine. I am sure the connection string is
> correct. I am running a collection of queries and finally commit the
> transaction, but everytime it not throwing the exception on same query,
> eachtime different queries throw exception randomly.
> Can anyone tell whats the problem?
> Urgent, Please help...
> Looking forward for the response..
> Thanx in advance...
>
|||Hai,
Thanx for ur reply...
In ran the query from Profiler, it works fine... and the URL that u
provide doesnt works...
Looking forward for the response...
John Bell wrote:
[vbcol=seagreen]
> Hi
> Have you printed out the SQL Statement before you send it to the server? You
> may want to use SQL Profiler to see what/if anything is being sent to the
> server.
> Have you also checked out
> http://support.microsoft.com/default...b;en-us;18189?
> John
> "Prince" wrote:
|||Hi
Try http://support.microsoft.com/kb/181890
You may want to check MDAC versions.
John
"Prince" wrote:

> Hai,
> Thanx for ur reply...
> In ran the query from Profiler, it works fine... and the URL that u
> provide doesnt works...
> Looking forward for the response...
>
> John Bell wrote:
>
>

DB_E_ERRORSINCOMMAND ( HRESULT = -2147217900 )

Hai all,
I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
recordset or execute query in VC++. But when I run the same query in
Query Analyzer, it is working fine. I am sure the connection string is
correct. I am running a collection of queries and finally commit the
transaction, but everytime it not throwing the exception on same query,
eachtime different queries throw exception randomly.
Can anyone tell whats the problem?
Urgent, Please help...
Looking forward for the response..
Thanx in advance...Hi
Have you printed out the SQL Statement before you send it to the server? You
may want to use SQL Profiler to see what/if anything is being sent to the
server.
Have you also checked out
http://support.microsoft.com/defaul...kb;en-us;18189?
John
"Prince" wrote:

> Hai all,
> I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
> recordset or execute query in VC++. But when I run the same query in
> Query Analyzer, it is working fine. I am sure the connection string is
> correct. I am running a collection of queries and finally commit the
> transaction, but everytime it not throwing the exception on same query,
> eachtime different queries throw exception randomly.
> Can anyone tell whats the problem?
> Urgent, Please help...
> Looking forward for the response..
> Thanx in advance...
>|||Hai,
Thanx for ur reply...
In ran the query from Profiler, it works fine... and the URL that u
provide doesnt works...
Looking forward for the response...
John Bell wrote:
[vbcol=seagreen]
> Hi
> Have you printed out the SQL Statement before you send it to the server? Y
ou
> may want to use SQL Profiler to see what/if anything is being sent to the
> server.
> Have you also checked out
> http://support.microsoft.com/defaul...kb;en-us;18189?
> John
> "Prince" wrote:
>|||Hi
Try http://support.microsoft.com/kb/181890
You may want to check MDAC versions.
John
"Prince" wrote:

> Hai,
> Thanx for ur reply...
> In ran the query from Profiler, it works fine... and the URL that u
> provide doesnt works...
> Looking forward for the response...
>
> John Bell wrote:
>
>sql

DB_E_ERRORSINCOMMAND ( HRESULT = -2147217900 )

Hai all,
I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
recordset or execute query in VC++. But when I run the same query in
Query Analyzer, it is working fine. I am sure the connection string is
correct. I am running a collection of queries and finally commit the
transaction, but everytime it not throwing the exception on same query,
eachtime different queries throw exception randomly.
Can anyone tell whats the problem?
Urgent, Please help...
Looking forward for the response..
Thanx in advance...Hi
Have you printed out the SQL Statement before you send it to the server? You
may want to use SQL Profiler to see what/if anything is being sent to the
server.
Have you also checked out
http://support.microsoft.com/default.aspx?scid=kb;en-us;18189?
John
"Prince" wrote:
> Hai all,
> I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
> recordset or execute query in VC++. But when I run the same query in
> Query Analyzer, it is working fine. I am sure the connection string is
> correct. I am running a collection of queries and finally commit the
> transaction, but everytime it not throwing the exception on same query,
> eachtime different queries throw exception randomly.
> Can anyone tell whats the problem?
> Urgent, Please help...
> Looking forward for the response..
> Thanx in advance...
>|||Hai,
Thanx for ur reply...
In ran the query from Profiler, it works fine... and the URL that u
provide doesnt works...
Looking forward for the response...
John Bell wrote:
> Hi
> Have you printed out the SQL Statement before you send it to the server? You
> may want to use SQL Profiler to see what/if anything is being sent to the
> server.
> Have you also checked out
> http://support.microsoft.com/default.aspx?scid=kb;en-us;18189?
> John
> "Prince" wrote:
> > Hai all,
> >
> > I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
> > recordset or execute query in VC++. But when I run the same query in
> > Query Analyzer, it is working fine. I am sure the connection string is
> > correct. I am running a collection of queries and finally commit the
> > transaction, but everytime it not throwing the exception on same query,
> > eachtime different queries throw exception randomly.
> >
> > Can anyone tell whats the problem?
> > Urgent, Please help...
> > Looking forward for the response..
> > Thanx in advance...
> >
> >|||Hi
Try http://support.microsoft.com/kb/181890
You may want to check MDAC versions.
John
"Prince" wrote:
> Hai,
> Thanx for ur reply...
> In ran the query from Profiler, it works fine... and the URL that u
> provide doesnt works...
> Looking forward for the response...
>
> John Bell wrote:
> > Hi
> >
> > Have you printed out the SQL Statement before you send it to the server? You
> > may want to use SQL Profiler to see what/if anything is being sent to the
> > server.
> >
> > Have you also checked out
> > http://support.microsoft.com/default.aspx?scid=kb;en-us;18189?
> >
> > John
> >
> > "Prince" wrote:
> >
> > > Hai all,
> > >
> > > I am getting an DB_E_ERRORSINCOMMAND exception when I try to open a
> > > recordset or execute query in VC++. But when I run the same query in
> > > Query Analyzer, it is working fine. I am sure the connection string is
> > > correct. I am running a collection of queries and finally commit the
> > > transaction, but everytime it not throwing the exception on same query,
> > > eachtime different queries throw exception randomly.
> > >
> > > Can anyone tell whats the problem?
> > > Urgent, Please help...
> > > Looking forward for the response..
> > > Thanx in advance...
> > >
> > >
>

db_datareader & Execute permissions on procs

I have a group of users that I have given db_datareader permissions to in an SQL Server 2000 database. I am also creating web pages on an intranet site that pulls data from the table. If I just use a select statement to pull the data from the table, the users dont have a problem. If I use a stored procedure with the exact same sql statement, the users get an error until I grant them execute permissions on the stored procedure.

I have heard that store procedures is the best way to handle data operations but having to make sure I assign execute permissions every time I create a stored procedures can be a pain. The only way I know of to make sure that they had permissions would be to make them a member of db_Owner which is definitely not an option.

Is this just the way it is, or is there some way to automatically grant them execute permissions on stored procedures that are nothing more than select statements and dont violate db_datareader permissions?I'm afraid that is the point of procs (from a security pov). You can allow execute on the sproc whilst not allowing them to access the underlying tables. Such granularity means you have to explicitly grant execute permissions on the stored procedures for the users to be able to use them.|||Hi there,

Yep as pootle says, you need to add exec permissions to SPs regardless of whether they have datareader or datawriter.
If you're not doing it already I would set up and NT group or custom database role then you wont need to add the permissions to each user all the time, just to the group or groups|||Alternatively, if you are using SQL 2005, you can grant SCHEMA permissions to a user or role.

grant execute on schema ::dbo to [public]

However, more granular permissions are considered at least a better, if not best, practice.|||thanks to all of you for your replies.sql

Saturday, February 25, 2012

DB Maintenance Plan from command line

Hi everyone !
Is it possible to execute a DB Maintenance Plan from command line (like
dtsrun) ?
Thank you !
Hugo
Great !
Thank you !
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a crit
dans le message de news: OzlKPcvPHHA.140@.TK2MSFTNGP04.phx.gbl...
> SQL Server 2000? If so, you can use OSQL, and from there execute
> sp_start_job.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Hugo" <hugorobichrg@.news.postalias> wrote in message
> news:u9Z1eFvPHHA.4424@.TK2MSFTNGP06.phx.gbl...
>

DB Maintenance Plan from command line

Hi everyone !
Is it possible to execute a DB Maintenance Plan from command line (like
dtsrun) ?
Thank you !
HugoSQL Server 2000? If so, you can use OSQL, and from there execute sp_start_jo
b.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hugo" <hugorobichrg@.news.postalias> wrote in message news:u9Z1eFvPHHA.4424@.TK2MSFTNGP06.phx
.gbl...
> Hi everyone !
> Is it possible to execute a DB Maintenance Plan from command line (like dt
srun) ?
> Thank you !
> Hugo
>|||Great !
Thank you !
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a crit
dans le message de news: OzlKPcvPHHA.140@.TK2MSFTNGP04.phx.gbl...
> SQL Server 2000? If so, you can use OSQL, and from there execute
> sp_start_job.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Hugo" <hugorobichrg@.news.postalias> wrote in message
> news:u9Z1eFvPHHA.4424@.TK2MSFTNGP06.phx.gbl...
>

DB Maintenance Plan from command line

Hi everyone !
Is it possible to execute a DB Maintenance Plan from command line (like
dtsrun) ?
Thank you !
HugoSQL Server 2000? If so, you can use OSQL, and from there execute sp_start_job.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
"Hugo" <hugorobichrg@.news.postalias> wrote in message news:u9Z1eFvPHHA.4424@.TK2MSFTNGP06.phx.gbl...
> Hi everyone !
> Is it possible to execute a DB Maintenance Plan from command line (like dtsrun) ?
> Thank you !
> Hugo
>|||Great !
Thank you !
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> a écrit
dans le message de news: OzlKPcvPHHA.140@.TK2MSFTNGP04.phx.gbl...
> SQL Server 2000? If so, you can use OSQL, and from there execute
> sp_start_job.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
>
> "Hugo" <hugorobichrg@.news.postalias> wrote in message
> news:u9Z1eFvPHHA.4424@.TK2MSFTNGP06.phx.gbl...
>> Hi everyone !
>> Is it possible to execute a DB Maintenance Plan from command line (like
>> dtsrun) ?
>> Thank you !
>> Hugo
>

Friday, February 17, 2012

DB Help!!

I have 2 instances. I want to view data in instance2, from instance1

I am at instance1, and i try to execute this:
select * from table@.dblink2

and i get ORA-02019, so i then i execute this on instance1:

select * from all_db_links;

Result:
Owner Username DB_link Host
PUBLIC|RHE |dblink2 |instance2|

So, whats missing, there is a DB link created from instance1 to instance2, so why am i not able to view the data from instance2 ??

Please respond ASAP.....Try setting the:

GLOBAL_NAMES=FALSE

parameter on both initSID1.ora and initSID2.ora files and re-start the instances.

Tuesday, February 14, 2012

db fixed role - datareader

Hi,
If I assign a datareader role to a user, can that user execute the stored
procedure? or datareader only means all the select rights, how about
datawriter? Can datawrite execute the stored procedure?
Thanks
Eddatareader = select
datawriter = insert, delete, update
You have to grant execute permission to the user or role.
"Ed" <Ed@.discussions.microsoft.com> wrote in message
news:FF9ED2C9-70E4-4329-8B8A-71D4400907B1@.microsoft.com...
> Hi,
> If I assign a datareader role to a user, can that user execute the stored
> procedure? or datareader only means all the select rights, how about
> datawriter? Can datawrite execute the stored procedure?
> Thanks
> Ed|||No, it only gives SELECT rights. Same for datawriter, it gives (as Richard
says) INSERT, UPDATE, DELETE rights. If you have procedures, they have to
be permissioned separately. It does not extrapolate that you want them to
be able to execute the proc because they have rights to the objects. The
procedure might have a calculation that you don't want the user to have
access to.
----
Louis Davidson - drsql@.hotmail.com
SQL Server MVP
Compass Technology Management - www.compass.net
Pro SQL Server 2000 Database Design -
http://www.apress.com/book/bookDisplay.html?bID=266
Blog - http://spaces.msn.com/members/drsql/
Note: Please reply to the newsgroups only unless you are interested in
consulting services. All other replies may be ignored :)
"Ed" <Ed@.discussions.microsoft.com> wrote in message
news:FF9ED2C9-70E4-4329-8B8A-71D4400907B1@.microsoft.com...
> Hi,
> If I assign a datareader role to a user, can that user execute the stored
> procedure? or datareader only means all the select rights, how about
> datawriter? Can datawrite execute the stored procedure?
> Thanks
> Ed|||In this case what set-up would you recommend for a user that can only read
data, ie datareader but has access to stored procs which may insert data int
o
tables. Is this possible? Thanks.
"Louis Davidson" wrote:

> No, it only gives SELECT rights. Same for datawriter, it gives (as Richar
d
> says) INSERT, UPDATE, DELETE rights. If you have procedures, they have to
> be permissioned separately. It does not extrapolate that you want them to
> be able to execute the proc because they have rights to the objects. The
> procedure might have a calculation that you don't want the user to have
> access to.
> --
> ----
--
> Louis Davidson - drsql@.hotmail.com
> SQL Server MVP
> Compass Technology Management - www.compass.net
> Pro SQL Server 2000 Database Design -
> http://www.apress.com/book/bookDisplay.html?bID=266
> Blog - http://spaces.msn.com/members/drsql/
> Note: Please reply to the newsgroups only unless you are interested in
> consulting services. All other replies may be ignored :)
> "Ed" <Ed@.discussions.microsoft.com> wrote in message
> news:FF9ED2C9-70E4-4329-8B8A-71D4400907B1@.microsoft.com...
>
>