Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Database > SQL Language
|
SQL Language SQL Language discussions not specific to a particular RDBMS program or vendor.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Language section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 6th, 2006, 01:36 PM
Registered User
 
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default Stored procedure problem

Hello.

The stored procedure posted below appears to run fine, but when I go back to look at the record, no changes have been made. Any suggestions as to what may be going wrong will be greatly appreciated.

Thanks in advance.

Donna

Code:
ALTER PROCEDURE dbo.spUpdateRecord
/*Created 9/20/2005 by DSpivey
Updates records in tblMoniesReceived*/

    (
        @RoutingID varchar (13),
        @Type varchar (5),
        @RecDate datetime,
        @From varchar (50),
        @AmtRecd money,
        @AmtDue money,
        @LateFee money,
        @Total money,
        @CheckDate datetime,
        @CheckNo varchar (20),
        @LicNo varchar (7),
        @SSN varchar (9),
        @NPN varchar (20),
        @NAIC varchar (5),
        @Source varchar (4),
        @Receipt varchar (6),
        @SubReceipt varchar (6),
        @TA varchar (50),
        @Copies varchar (5),
        @CRNum varchar (20),
        @Misc varchar (100),
        @Comments varchar (1000),
        @EditDate datetime
    )

AS

Update tblMoniesReceived
Set @RoutingID = vchRoutingID, @Type = vchEntryType, @RecDate = 
    dtReceivedDate, @From = vchReceivedFrom, @AmtRecd = 
    mAmountReceived, @AmtDue = mAmountDue, @LateFee = mLateFee, 
    @Total = mTotalDue, @CheckDate = dtCheckDate, @CheckNo = 
    vchCheckNumber, @LicNo = vchLicenseNumber, @SSN = vchSSN, @NPN = 
    vchNPN, @NAIC = vchNAIC, @Source = vchSourceCode, @Receipt = 
    vchReceiptType, @SubReceipt = vchSubReceiptType, @TA = 
    vchTitleAgent, @Copies = vchNumCopies, @CRNum = vchCRNumber,
    @Misc = vchMiscDescription, @Comments = vchComments, @EditDate = 
    dtDateEdited
where vchRoutingID = @RoutingID

SET NOCOUNT ON
RETURN
 
Old February 6th, 2006, 01:39 PM
Authorized User
 
Join Date: Sep 2005
Posts: 95
Thanks: 0
Thanked 0 Times in 0 Posts
Default

yes you have to swith the field names and parameters around

Update tblMoniesReceived
Set vchRoutingID = @RoutingID , vchEntryType =@Type etc etc etc

and then it will work



“I sense many useless updates in you... Useless updates lead to fragmentation... Fragmentation leads to downtime...Downtime leads to suffering..Fragmentation is the path to the darkside.. DBCC INDEXDEFRAG and DBCC DBREINDEX are the force...May the force be with you" -- http://sqlservercode.blogspot.com/
 
Old February 6th, 2006, 01:44 PM
Registered User
 
Join Date: Aug 2004
Posts: 9
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Ten thousand thank yous!!!!:D





Similar Threads
Thread Thread Starter Forum Replies Last Post
Problem with stored procedure analuz ADO.NET 1 July 18th, 2007 08:33 AM
Stored procedure problem akumarp2p Reporting Services 1 May 29th, 2007 01:25 AM
Problem in stored procedure hkec SQL Language 1 October 6th, 2006 02:29 PM
Stored Procedure Problem kwilliams SQL Server 2000 7 June 23rd, 2006 03:03 PM
Stored Procedure Problem brettdavis4 ASP.NET 1.0 and 1.1 Basics 7 November 3rd, 2003 09:46 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.