It's my first time incorporating a custom identity sequence in one of my projects. I have a stored procedure for inserting new records into the database. I have this but not too sure how to incorporate it into my existing stored procedure.
Here's the script that I want to add into my stored procedure:
PatientID AS '23-' + RIGHT('0000000' + CAST(PatientID AS NVARCHAR(3)), 3) PERSISTED
Trying to add into this section of my stored procedure:
@GroundServiceDate NVARCHAR(100),
@GroundInvoice NVARCHAR(100),
@GroundPaymentMethod NVARCHAR(50),
@GroundVoucherId NVARCHAR(100)
AS
BEGIN
SET NOCOUNT ON;
PatientID AS '23-' + RIGHT('0000000' + CAST(PatientID AS NVARCHAR(3)),3) PERSISTED
INSERT INTO tblReferrals (PatientID, ReferralNumber, AssignedReviewer, S
1条答案
按热度按时间8oomwypt1#
Why not just create a string variable inside your stored procedure to store that calculation into, and then use it in the INSERT?