Stored procedure not working

I am using ASP classic and MS SQL 2008. I have a stored procedure that is not updating the data at all, I am not sure why because I am displaying the values on the screen and they look correct to me, the SP is simply not doing the job.

Here is the code for the SP.

USE [BlueDot]
GO

/****** Object:  StoredProcedure [dbo].[BlueDotUpdateAddInfo]    Script Date: 09/15/2015 16:45:51 ******/
SET ANSI_NULLS OFF
GO

SET QUOTED_IDENTIFIER OFF
GO



CREATE PROCEDURE [dbo].[BlueDotUpdateAddInfo]
    @UserId INT ,
    @editor1 VARCHAR(8000)
AS
    UPDATE  dbo.Users
    SET     Customtxt = @editor1
    WHERE   UserId = @UserId;

GO

Open in new window


This is the ASP code that calls the SP to update the DB:

<%

Dim sp_updatecustomtxt__UserId
sp_updatecustomtxt__UserId = "0"
if(Request("UserId") <> "") then sp_updatecustomtxt__UserId = Request("UserId")

Dim sp_updatecustomtxt__editor1
sp_updatecustomtxt__editor1 = "0"
if(Request("Editor1") <> "") then sp_updatecustomtxt__editor1 = Request("Editor1")

%>

<%

set sp_updatecustomtxt = Server.CreateObject("ADODB.Command")
sp_updatecustomtxt.ActiveConnection = MM_bluedot_STRING
sp_updatecustomtxt.CommandText = "dbo.BlueDotUpdateAddInfo"
sp_updatecustomtxt.CommandType = 4
sp_updatecustomtxt.CommandTimeout = 0
sp_updatecustomtxt.Prepared = true
sp_updatecustomtxt.Parameters.Append sp_updatecustomtxt.CreateParameter("@RETURN_VALUE", 3, 4)
sp_updatecustomtxt.Parameters.Append sp_updatecustomtxt.CreateParameter("@UserId", 3, 1,4,sp_updatecustomtxt__UserId)
sp_updatecustomtxt.Parameters.Append sp_updatecustomtxt.CreateParameter("@editor1", 200, 1,8000,sp_updatecustomtxt__editor1)
sp_updatecustomtxt.Execute()

%>

Open in new window


And here is the Page source view:

<html>
<head>
<title>Update Additional Information</title>
</head>
<body>
<p>Value of editor 1 :                                             <p>This is a test, value in database should be THIS.</p><p><br></p>
<p>userid : 30638</p>
</body>
</html>

Open in new window

LVL 1
AleksAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

lcohanDatabase AnalystCommented:
Did you tested just the SP execution in SQL via SSMS?
like:

USE [BlueDot]
GO

EXEC BlueDotUpdateAddInfo  @UserId 1234,   @editor1 = 'bla..bla';

--then


USE [BlueDot]
GO
SELECT Customtxt FROM dbo.Users  WHERE   UserId = 1234;


Just MAKE SURE you don't run what I posted above in a PROD database AS IS...
If that doesn't work you should at least get an error or someting...maybe a trigger on that User table prevents the UPDATE?
0
AleksAuthor Commented:
I just did and it worked fine.  I ran this:

USE [BlueDot]
 GO

 EXEC BlueDotUpdateAddInfo  @UserId = 30638,   @editor1 = 'Hello world';

Open in new window

0
lcohanDatabase AnalystCommented:
In that case this is not a "Stored procedure not working" issue but something else outside SQL. Are you sure you trap all errors in code executing it and that you execute it against desired database table? I mean please double check the connection string?
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Cloud Class® Course: Amazon Web Services - Basic

Are you thinking about creating an Amazon Web Services account for your business? Not sure where to start? In this course you’ll get an overview of the history of AWS and take a tour of their user interface.

AleksAuthor Commented:
It looks like all is fine but Ill recheck. Maybe the SP is not getting the values right ... sigh !
0
AleksAuthor Commented:
You were right :#  .. a parameter was misspelled ... thx tho.
0
lcohanDatabase AnalystCommented:
Anytime...
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.