Hi ALL,
Below are the Scripts for 2 Tables Named Customers and Customers_ . I want to insert records from the Customers table
in the test server :10.130.400.54 , User Credentials- Username :test_serv,Password :test@123
into the Customers_ table in the test server:10.301.401.55 ,User Credentials - User Name : test_serv2,Password : test@123
with opendatasource function .
The Table customers_ has the identity key enabled on the customerid column where as there is no identity key on the customers table customerid column.
There is an extra column in the customers_ table and the condition for the insert is if the email id's in both the source and
destination table are same so for them the insert should not take place. Kindly help very urgent need
Sql Scripts :
CREATE TABLE [dbo].[Customers_](
[CustomerId] [bigint] IDENTITY(1,1) NOT NULL Primary Key,
FirstName varchar(75),
LastName varchar(75),
EmailID varchar(100),
)
CREATE TABLE [dbo].[Customers](
[CustomerId] int,
FirstName varchar(75),
LastName varchar(75),
EmailID varchar(100),
Source varchar(50),
)
insert into Customers_ values('Travaus','Berlies','Travaus.Berlies@yahoo.com')
insert into Customers_ values('John','Coyz','John.Coyz@yahoo.com')
insert into Customers_ values('Jeff','Nowals','Jeff.Noylz @Gmail.com')
go
insert into Customers values(27,'Travaus','Berlies','Travaus.Berlies@yahoo.com')
insert into Customers values(35,'John','Coyz','John.Coyz@yahoo.com')
insert into Customers values(44,'Jeff','Nowals','Jeff.Noylz @Gmail.com')
insert into Customers values(71,'Ray','kingston','Ray.Kingston @Gmail.com')
insert into Customers values(80,'Ron','Cranes','Ron.Cranes @Gmail.com')
go