Hi, kindly seeking for help on how i can use a stored procedure to select data from one table and insert into another..i have the below stored procedure..kindly help on how i implement it to achieve inserting data from one table to another.
- CREATE PROCEDURE [enterprise].[send_sms]
- (
- @CompanyID NVARCHAR(72),
- @BranchID NVARCHAR(36),
- @DepartmentID NVARCHAR(36),
- @Value nvarchar(36)=''
- )
- AS
- DECLARE @EmployeeName nvarchar(36)
- DECLARE @EmployeeMobilePhone nvarchar(36)
- DECLARE @VendorName nvarchar(36)
- DECLARE @VendorPhone nvarchar(36)
- DECLARE @PatientName nvarchar(36)
- DECLARE @PatientCellPhone nvarchar(36)
- BEGIN
- IF @Value='Patients'
- BEGIN
- select PatientName,PatientCellPhone from CustomerInformation
- END
- ELSE IF @Value='Suppliers'
- BEGIN
- select VendorName,VendorPhone from VendorInformation
- END
- ELSE IF @Value='Employees'
- BEGIN
- select EmployeeName,EmployeeMobilePhone from PayrollEmployees
- END
- END

Anurag Sharma56 reputationPosted Feb 27, 2018, 8:18 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Feb 26, 2018, 8:58 PM EST
Francis Bastin149 reputationPosted Feb 26, 2018, 8:29 PM EST
Piyush PansuriyaRank #454 · 5.5K reputationPosted Feb 26, 2018, 8:31 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Feb 26, 2018, 8:33 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Feb 26, 2018, 8:34 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Feb 26, 2018, 8:41 PM EST
Piyush PansuriyaRank #454 · 5.5K reputationPosted Feb 26, 2018, 8:45 PM EST
Piyush PansuriyaRank #454 · 5.5K reputationPosted Feb 26, 2018, 8:56 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Feb 26, 2018, 9:17 PM EST
john kanyoraRank #6,677 · 259 reputationPosted Feb 26, 2018, 8:49 PM EST