TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Thulasiram pakala
899
872
114.8k
scope identity want to add 'CM00'
Apr 28 2021 2:27 AM
scope identity want to add 'CM00' that value not null then want to insert other table
in this process id @ProcessID want add this string 'CM00' and insert to this value in other table eg CM0001 like tha
ALTER PROCEDURE [dbo].[Insert_Header_Details_Tables](@ProcessID [int]=null, @FileName [varchar](50)=null,@VendorName [varchar](250)=null, @LastName [nvarchar](100)=null,@FirstName [nvarchar](100)=null,@isFirstMSH [bit])
AS --BEGIN TRANSACTION -- Insert into Jobs table
IF(@isFirstMSH = 1)
BEGIN INSERT INTO LabStagingHeader([FileName], [VendorName] ) VALUES (@FileName,@VendorName)
END -- Retrieve the automatically @ProcID VALUE from the Header table SET @ProcessID = SCOPE_IDENTITY()-- Insert new values into LabStagingDetails table INSERT INTO LabStagingDetails ([ProcessID],[LastName],[FirstName] ) VALUES (@ProcessID, @LastName,@FirstName)
Reply
Answers (
0
)
I wrote store rpocedure i want to check data saved then need to insert
convertion nvarchar to numaric error please