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 SharmaPosted Feb 28, 2018, 1:18 AM
john kanyoraPosted Feb 27, 2018, 2:17 AM
john kanyoraPosted Feb 27, 2018, 1:58 AM
Piyush PansuriyaPosted Feb 27, 2018, 1:56 AM
john kanyoraPosted Feb 27, 2018, 1:49 AM
Piyush PansuriyaPosted Feb 27, 2018, 1:45 AM
john kanyoraPosted Feb 27, 2018, 1:41 AM
john kanyoraPosted Feb 27, 2018, 1:34 AM
john kanyoraPosted Feb 27, 2018, 1:33 AM
Piyush PansuriyaPosted Feb 27, 2018, 1:31 AM
Francis BastinPosted Feb 27, 2018, 1:29 AM