Showing posts with label dbo. Show all posts
Showing posts with label dbo. Show all posts

Thursday, February 16, 2012

ADO errors after changing SP to use local variable

Changed stored procedure

[dbo].[spLogonName @.pNewLogonName varchar(60) AS

SELECT * FROM .dbo.tblUser Where vcLogonName = @.pNewLogonName

to

[dbo].[spLogonName @.pNewLogonName varchar(60) AS

DECLARE @.Local_pNewLogonName varchar(60)

SET @.Local_pNewLogonName = @.pNewLogonName

SELECT * FROM .dbo.tblUser Where vcLogonName = @.Local_pNewLogonName

and started getting this error on the web page.

ADODB.Recordset error '800a0cb3'

Current Recordset does not support updating. This may be a limitation of the provider, or of the selected locktype.

Does anyone know why this is happening? Nothing on the site has changed. If I change the sp back the errors go away. I'm trying to use local variables in all SP to avoid the slowness that can happen when using the parameter varibles.

Hi,

I guess you've changed the stored proc to avoid parameter sniffing and make sure the execution plan is stable? :-)

Could you try adding SET NOCOUNT ON to the beginning of the procedure? I suspect you're getting an additional DONE token from the SET statement and multiple recordsets. You could probably test that by calling NextRecordset method of the recordset.

HTH,
Jivko Dobrev - MSFT
--
This posting is provided "AS IS" with no warranties, and confers no rights.

|||

Hello and thanks for the response.

Yes, I'm trying to change the sp to avoid sniffing.

I added SET NOCOUNT ON to the beginning of the procedure but it did not help. I removed the local variable stuff and left the NOCOUNT statement in and it doesn't like it either. It seems like it doesn't like any statements in the sp except the SELECT.

Here is more information if it helps.

Set query = Session_LogonNameQuery(NewLogonName)
Set oRecordSet = New ADODB.Recordset
Set oRecordSet = RetrieveDataRS(myconn, query, adOpenForwardOnly, adLockOptimistic, 1)

Even though I have adLockOptimistic selected the recordset has adLockReadOnly set.

Any help would be appreciated.

Thursday, February 9, 2012

administering jobs and targetserversrole

My goal is to allow my developers to create and modify jobs on our
development server. To this end, I have put the developers (who are dbo in
their respective db), in an nt group and put them in the targetserversrole
in msdb on the server. In addition, by changing the role and granting
execute to the add,delete,and update job stored procedure groups and the job
start and stop stored procedures I am able to allow the group to add and
modify jobs, except for one item in the job and that is to set up job
notifications. I have tried granting the add,update and delete notification
group but that doesn't do it as the check boxes are still disabled for the
developers when they look at that part of the job. Does anyone know what I
am missing in this plan? Thanks in advance for any help solving this.One of the problems with this approach is that it's not
documented or supported. The role really isn't meant to be
used outside of SQL Server using it for MSX. If you use this
role, you will find that things change if/when you apply SP3
and who knows what other service packs or fixes may change
the functionality of the role.
-Sue
On Tue, 4 May 2004 09:12:53 -0400, "MarkR"
<mrussell@.dasny.org.dontspamme.net> wrote:

>My goal is to allow my developers to create and modify jobs on our
>development server. To this end, I have put the developers (who are dbo in
>their respective db), in an nt group and put them in the targetserversrole
>in msdb on the server. In addition, by changing the role and granting
>execute to the add,delete,and update job stored procedure groups and the jo
b
>start and stop stored procedures I am able to allow the group to add and
>modify jobs, except for one item in the job and that is to set up job
>notifications. I have tried granting the add,update and delete notificatio
n
>group but that doesn't do it as the check boxes are still disabled for the
>developers when they look at that part of the job. Does anyone know what I
>am missing in this plan? Thanks in advance for any help solving this.
>
>