1

这是我在 SQL Server 中更新表的存储过程,但我似乎无法让它工作该语句有什么问题。

Update pc.PatientCopayId, pc.amount, pc.patientid, pc.apptid ,p.PaymentId,p.PaymentDate,p.PayorType,p.PaymentMethod,
      p.RefNumber,p.PaymentAmount,p.PayorId,pt.LastFirstName As PatientName,
      ISNULL((SELECT note FROM dbo.PatientNote WHERE NoteTypeId = 28 AND KeyValue = pc.PatientCopayId),'') AS Note
from [dbo].[PatientCopay] pc, dbo.pymt_Payment p, dbo.Patient pt
where ApptId =  @ApptId
  and p.PaymentId = pc.Paymentid
  And pt.PatientId = p.PayorId

价值观和意义

pc.amount, = @PaymentAmount
pc.patientid, = @PatientId
pc.apptid , = @ApptId
p.PaymentId, = @PaymentId
p.PaymentDate, = @PaymentDate
p.PayorType, = @PayorType
p.PaymentMethod, = @PaymentMethod
p.RefNumber, = @RefNumber
p.PaymentAmount, = @PaymentAmount
p.PayorId, = @PayorId
4

1 回答 1

7

UPDATE语句应具有以下形式

UPDATE TableName SET....

您的更新语句没有表名或 SET 关键字。

更多信息在这里

于 2013-08-22T15:05:58.583 回答