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
john kanyora
NA
242
46.3k
how to insert data from one table to another
Feb 27 2018 1:23 AM
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
Reply
Answers (
11
)
What is the alternative of Identity in Sql Server ?
Column value insert in limit time