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