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]

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


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


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)


Open in new window

And here is the Page source view:

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

Open in new window

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

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?

USE [BlueDot]

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


USE [BlueDot]
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?
AleksAuthor Commented:
I just did and it worked fine.  I ran this:

USE [BlueDot]

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

Open in new window

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?

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
JavaScript Best Practices

Save hours in development time and avoid common mistakes by learning the best practices to use for JavaScript.

AleksAuthor Commented:
It looks like all is fine but Ill recheck. Maybe the SP is not getting the values right ... sigh !
AleksAuthor Commented:
You were right :#  .. a parameter was misspelled ... thx tho.
lcohanDatabase AnalystCommented:
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

From novice to tech pro — start learning today.