How to insert data from one server to another server?

Dear frnds
i have written the script in server ABC and the database XYZ, so i want to insert the data into the second server Customserver
hw should i insert the data .
Iam already tried for this creating the Linked server and exueting the script and inserting the data into that table but it will working on the current query editor only  but
it should not been updated on the Target server database table.
below is the script pls help me out for this...
-- Creating the Linked server instance
sp_addlinkedserver 'sp_helpserver','','SQLNCLI',Null,Null,'Server=ABC001',Null
exec SP_addlinkedsrvlogin 'sp_helpserver','false',Null,'nshy22','#abx123'
--Insert  data into the do.children
Truncate table dbo.children
Insert into dbo.Site_Table
select distinct Name, Code,State,
 from dbo.children
--Insert data into the master
Truncate table Master
insert  into Master  
Select Code,Name,country from dbo.master

Hello,
The SQL Server forums are over here:
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/home
Karl
When you see answers and helpful posts, please click Vote As Helpful, Propose As Answer, and/or Mark As Answer.
My Blog: Unlock PowerShell
My Book:
Windows PowerShell 2.0 Bible
My E-mail: -join ('6F6C646B61726C406F75746C6F6F6B2E636F6D'-split'(?<=\G.{2})'|%{if($_){[char][int]"0x$_"}})

Similar Messages

  • How  to transfer data from one system to another by datamart please give de

    how  to transfer data from one system to another by datamart please give details

    Hi Deba,
    Find the below SAP help doc which may help u...
    http://help.sap.com/saphelp_nw70/helpdata/en/12/43074208ae2a38e10000000a1550b0/frameset.htm
    Also find the below threads...
    Loading data from one cube to another cube.
    data copy from infocube to infocube in two different BW systems
    Delta when loading from ODS to ODS
    reg datamart
    Data mart flag
    Regards,
    KK.

  • How to transfer data from one macbookpro to another

    how to you transfer data from one macbookpro to another. the other one was stolen.

    If your computer was stolen and you don't have a data backup, you can't transfer data from the stolen computer to your new one. If you have a data backup, restore the data to the new computer.

  • How to transfer DATA from one machine to another using  DBlink

    I want to transfer data from one machine to another both having oracle 8.0.5 with AIX operating system using DB link. CAn any one help me in this task

    Step one - Create and test SQLNet connections between the databases.
    Step two - Create at least on database like from one database to the other:
    CREATE DATABASE LINK linkname
    CONNECT TO user identified by password
    USING 'tnsnamesentry';
    Step three - use the dblink linkname in dml statements eg:
    insert into emp@linkname
    (select * from emp);

  • Inserting data from one table into another table using PL/SQL

    HI,
    I am trying to insert values from one table into another using PL procedure, the values I want to retrieve from the table riverside1 are charac_id and charac_type and insert these values into another table called riverside2 , the stored procedure zorgs_gorfs(x,y) accepts two parameters which are 2 charac_id's of d characters in riverside1 then using insert statements inserts these characters from riverside1 into riverside2.
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (x);
    INSERT INTO riverside2
                   (charac_id)
              VALUES
                   (y);
          END zorgs_gorfs;
    /This works but the problem im having is that when I also try to insert the charac_type as well as the charac_id it doesnt work below is the code:
    CREATE OR REPLACE PROCEDURE zorgs_gorfs(x IN NUMBER, y IN NUMBER) AS
         BEGIN
              INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);
          END zorgs_gorfs;
    /can someone kindly sort me out

    modify this sql
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id = x);as
    INSERT INTO riverside2
                   (charac_id,charac_tye)
              VALUES
                   (Select
                        charac_id,
                        charc_type
                   FROM
                        riverside1
                   WHERE
                        charac_id in ( x,y));But my suggestion would be consider revising your approach. It does not look that good.
    Thanks,
    karthick.

  • How to copy data from one table to another (in other database)

    Hi. I would like to copy all rows from one table to another (and not use BC4J). Tables can be in various databases. I have already 2 connections and I am able to browse source table using
    ResultSet rset = stmt.executeQuery("select ...");
    But I would not like to create special insert statement for every row . There will be problems with date formats etc and it will be slow. Can I use retrieved ResultSet somehow ? Maybe with method insertRow, but how, if ResultSet is based on select statement and want to insert into target table? Please point me in the right direction. Thanks.

    No tools please, it must be common solution. We suceeded in converting our BC4J aplication to PostgreSQL, the MSSQL will be next. So we want to write simple aplication, which could transfer data from our tables between these 3 servers.

  • How to transport data from one tab to another(mapinfo)?

    Hello all,
    due to a change of design i have to transport datas from one
    spatial table to another in order to use them in mapinfo.
    How can i handle this with polygon datas?
    if i just do a simple "insert into tab select * from anothertab;
    all std datas are moved but the spatials generate errors while
    opening in mapinfo (illegal data type) any ideas or suggestions?
    Thanks i advance,
    Volker I. Lipper

    Hi,
    just a guess - maybe the necessary metadata is missing. I suggest
    you check the MAPINFO.MAPINFO_MAPCATALOG table for the
    appropriate entry (for "anothertab"). If there is no
    corresponding row, you need to make the table mappable in Mapinfo
    Pro first.
    Hope this helps,
    --- Hans.

  • Inserting data from one table to another in different format

    Hello,
    I would like to know what I am doing wrong with the following code when I write a data from one another to another table in a different format. I am now learning PL/SQL and am using this as
    a test problem.
    I have a table called students which has the following columns:
    SQL> desc student
    Name Null? Type
    ----------- ----------------STUDENT_ID NUMBER(10)
    COURSE VARCHAR2(10)
    CREDITS NUMBER(10)
    I have created another table called new_student which has the following structure:
    SQL> desc new_student
    Name Null? Type
    ----------------------------------------- -------- ------------- STUDENT_ID NUMBER(10)
    COURSE VARCHAR2(30)
    CREDITS VARCHAR2(10)
    The data in the student table is:
    SQL> select * from student;
    STUDENT_ID COURSE CREDITS
    1 Science 4
    1 History 3
    2 Science 4
    2 History 3
    2 Math 4
    3 Sociology 3
    3 Psycology 3
    I want to store the STUDENT table data in NEW_STUDENT table as:
    STUDENT ID COURSES CREDITS
    1 Science/History 4/3
    2 Science/History/Math 4/3/4
    3 Sociology/Psycology 3/3
    This is my code:
    DECLARE
    -- Get all the student IDs
    CURSOR studentlist_cursor IS select distinct student_id from student ORDER BY student_id;
    -- Get the information for each student ID
    CURSOR courses_cursor(nstudentid number) is select course, credits from student where student_id=nstudentid;
    nIndex     INTEGER;
    pltcourses     DBMS_SQL.VARCHAR2_TABLE;
    pltcredits     DBMS_SQL.NUMBER_TABLE;
    newcourses varchar2(50);
    newcredits varchar2(10);
    BEGIN
    FOR student_rec IN studentlist_cursor
    LOOP
    nIndex:=0;
    -- Loop through each student ID from student_rec to get the
    --courses and creditsstudent ID
    FOR courses_rec in courses_cursor(student_rec.student_id)
         LOOP
         nIndex:=nIndex+1;
         pltcourses(nIndex):=courses_rec.course;
    -- Store the course data for each student ID in newcourses
    -- while doing so check if it is null or put a '/' between each course
    loop
    if newcourses is null then
    newcourses:=pltcourses(nIndex);
    else
    newcourses:=newcourses||'/'||pltcourses(nIndex);
    end if;
    end loop;
         pltcredits(nIndex):=courses_rec.credits;
    --Store credits data in variable newcredits
    --If the newcredits is not null then put a '/' between each credits
    loop
    if newcredits is null then
    newcredits:=pltcredits(nIndex);
    else
    newcredits:=newcredits||'/'||pltcredits(nIndex);
    end if;
    end loop;
    -- Insert student id, newcourses, newcredits into NEW_STUDENT
    INSERT INTO NEW_STUDENT
    (student_id ,
    course,
    credits
    ) VALUES
    (student_rec.student_id,
    newcourses,
    newcredits
    COMMIT;
    -- come out of the student id record and go to the next student --id record
    END LOOP;
    -- come out of the loop
    END LOOP;
    END;
    While doing so I get an error message:
    declare
    ERROR at line 1:
    ORA-06502: PL/SQL: numeric or value error
    ORA-06512: at line 23.
    The error is at the line:
    newcourses:=newcourses||'/'||pltcourses(nIndex);
    Can anyone help me by pointing out where the mistake is?
    Thank you for reading this long mail.
    Thank you.
    Rama.

    Hi dude
    there is lot of error in ur pl/sql.
    and u have created table new_student with columns
    student_id number(10),
    courses varchar2(30),
    credits number(10).
    first u need to modify ur table.
    student_id number(10),
    courses varchar2(30),
    credits varchar2(10).
    Now i am writing whole pl/sql block for u. it will work fine.
    DECLARE
    CURSOR studentlist_cursor IS select distinct student_id from student ORDER BY student_id;
    CURSOR courses_cursor(nstudentid number) is select course, credits from student
    where student_id = nstudentid;
    nIndex INTEGER;
    pltcourses DBMS_SQL.VARCHAR2_TABLE;
    pltcredits DBMS_SQL.NUMBER_TABLE;
    newcourses varchar2(50);
    newcredits varchar2(10);
    BEGIN
    FOR student_rec IN studentlist_cursor
    LOOP
    nIndex:=0;
    newcourses := null;
    newcredits := null;
    FOR courses_rec in courses_cursor(student_rec.student_id)
    LOOP
    nIndex:=nIndex+1;
    pltcourses(nIndex):=courses_rec.course;
    if newcourses is null then
    newcourses:=pltcourses(nIndex);
    else
    newcourses:=newcourses||'/'||pltcourses(nIndex);
    end if;
    pltcredits(nIndex):=courses_rec.credits;
    if newcredits is null then
    newcredits:=pltcredits(nIndex);
    else
    newcredits:=newcredits||'/'||pltcredits(nIndex);
    end if;
    end loop;
    INSERT INTO NEW_STUDENT
    (student_id,
    course) VALUES
    (student_rec.student_id,
    newcourses);
    END LOOP;
    END;
    and please revert back
    Regards
    Anil

  • How to transfer data from one client to another client

    Dear Experts,
    Please explain how to transfer data (Materials) from one client to another client?
    Thanks,
    Ajay Kumar

    Hi Ajay,
    Check any of below methods
    Refer thread http://scn.sap.com/thread/171981 where people use IDOCs for master data transfer.
    OR
    This is done by BASIS team, by client refresh or client copy. Check with your basis team for this and there is some predefined time when they plan this activity, and in most project they do it once in 3 months etc to get production environment in test system which helps to resolve issues of production by creating similar case in test system.
    Check below threads for more information
    http://sap.ittoolbox.com/groups/technical-functional/sap-basis/cleint-copy-vs-client-refresh-1377848
    http://basissap.blogspot.in/2008/05/what-is-client-copy.html
    OR
    You can download data from one client and upload in another through BDC or LSMW.
    Regards,
    Sharat

  • Inserting Data from one table to another.

    I running a procedure that loops through a cursor which is about 80,000 records(tableA) and I am trying to insert into another table(tableX) based on the data from tableA. I have error trapped the hell out of this and made sure I am covering any holes. When looping through the cursor, it insert only about 28,000 records and then exits the loop. I have debugged this problem 100 different ways and for the life of me I can not figure why it just craps out at about this many records. I actually located where the looping stops and took the next 5 records from tableA, and inserted them manually and they went through normally, which tells me that there should have been no reason why the executable statements exited the loop. I checked my space and I have more than enough. I have debugged the code many different ways, but still no luck. It always exits the procedure after inserting about 28,000 records. When I was debugging the code, I noticed that it would exit because one of my select into...statements was returning a NO_DATA_FOUND error, but I trapped that error, and assigned a value to that variable if it was null.
    I am really getting frustrated with this. Can anyone offer some suggestions or advice as to what I can do to acheive my goal?

    post the cursor , loop , definition.
    while you fire the cursor, on table A for
    insert in table X, what happens on A and X ?
    it tries to make a commit every 100/1000 time,
    until close the cursor.
    table definition X, is similar to A ?
    alert_$SID.log what says ?
    pasquale rago

  • How to move data from one database to another one?

    I 'd like to build up a new database, some of the data would come from an old database, then I have to make two connection objects to both databases, (two statement objects...) retrieving the data from the old one and inserting them to the new one.... sounds reasonable, huh? but it could not work this way... "........it would have caused the duplicated value , blah, blah..." even though I made two tables in two databases completely different, that errors are still there. seemed I cannot clone that table.
    could you guys have any better ideas? and why couldn't I go this way?
    the database: cloudscape3.01
    two databases are all on my local PC (WinNT4.0)
    thanks

    If you are getting dupicate record errors, then look at your recordset objects and make sure they are both pointing at seperate databases, and check the one you are using to output and make sure it isn't just writing NULL, if it is then trace up the line: your input (read) recordset may be reading NULL too.

  • How to transfer data from one phone to another

    my daughter got a new phone.  she is trying to transfer data from her old phone.  she cant remember her icloud password.  we can't have them email because the email uses the same password.  If i delete the account all the information we are trying to transfer will be lost.  Any idea how to retrieve the password?

    You transfer data to a new phone by backing up the old one, then restoring the backup to the new one (see http://support.apple.com/kb/ht2109).
    Also, deleting the account only deletes it from the phone, not from iCloud.  But if you're running iOS 7 with Find My iPhone turned on you'll need the password in order to delte the account.
    If you need to reset the password, contact Apple for assistance by going to https://expresslane.apple.com, then click More Products and Services>Apple ID>Other Apple ID Topics>Lost or forgotten Apple ID password.

  • Inserting data from one table to another table....

    Hi DB Gurus,
    I have two table like table A in instance X and table B in instance Y. I want to insert data into table A from table B.If data in table B already exist in table A then that should not insert .if data In table B is not present in table A then that data should insert into table A.
    please help me to how insert this kind of data.I am trying to insert data by using "insert into" statement.Is it correct way or not. please let me know...
    Thanks in advance
    Best regards
    kumar

    Hey There,
    "I have two table like table A in instance X and table B in instance Y"
    Are these 2 instances sitting in the same db/rac.
    if so
    insert into x.a
    select * from y.b
    If the 2 instances are in different databases/racs then i think you can add a linked db into your script.- not 100% about that though.
    Dob

  • Insert data from one table to another.

    I have two tables - T1 & T2.
    T1 has columns A1,A2,A3,A4 (A1 & A2 are the primary keys)
    T2 has columns B1,B2,B3,B4 (B1 & B2 are the primary keys)
    I need to insert records from T1 to T2 with the conditions,
    - A1,A2,A3 will have the same record for the multiple records of A4.
    This is what I tried and got the error:-
    SQL> INSERT INTO nego_prop_supp (nps_supp_cd, nps_enq_no, nps_supp_resp, nps_cs_rank)
    2 SELECT DISTINCT tos_supp_code, tos_enq_no, tos_bid_seal_condn, csr_set_rank
    3 FROM tender_opening_supp, cs_rate
    4 WHERE tos_enq_no = '7211233E' AND
    5 tos_supp_code = csr_scd AND
    6 (tos_nature_of_bid = 'P' or tos_nature_of_bid = 'N') AND
    7 csr_set_rank IS NOT NULL;
    INSERT INTO nego_prop_supp (nps_supp_cd, nps_enq_no, nps_supp_resp, nps_cs_rank)
    ERROR at line 1:
    ORA-00001: unique constraint (DPURC.NEGO_PROP_SUPP_PK) violated
    You could understand that T1 consists (data from 'tender_opening_supp' & cs_rate), while T2 is nego_prop_supp.
    Pls. get me the soution for thi problem!!

    then this query
    SELECT DISTINCT tos_supp_code, tos_enq_no, tos_bid_seal_condn, csr_set_rank
    3 FROM tender_opening_supp, cs_rate
    4 WHERE tos_enq_no = '7211233E' AND
    5 tos_supp_code = csr_scd AND
    6 (tos_nature_of_bid = 'P' or tos_nature_of_bid = 'N') AND
    7 csr_set_rank IS NOT NULL
    8 and not exists (select nps_supp_cd from nego_prop_supp,tender_opening_supp where tos_supp_code
    = nps_supp_cd) ;
    have more than one tos_supp_code (the same any times) with any different value from tos_enq_no, tos_bid_seal_condn, csr_set_rank
    then anything is wrong or your key(on nego_prop_supp ) or the query retrieve rows that you not want
    the join is ok?
    why this join retrieve more than one value with the key of the other table? Do you need to filter any more? are you missing a filter?

  • How to move data from one account to another?

    Sheesh, I think I've created a monster for myself.  I got a new macbook pro and migrated my data from Time Machine.  As I was doing everything I didn't realize that the set up for the computer was in a different account than the migrated data went to.  So I have my main account on the computer and another account with all my emails, itunes pics etc. 
    I think the other account is considered the main account on the computer so just to make sure I have all my privileges etc, I want to transfer all this data into the main account.  Does that make sense? 
    I started figuring all of this out as a problem when my second account (the one with all my old data) could not download podcasts.  I can do that with the main account. 
    Anyway, can anybody tell me a simple way to transfer all of this?  Should I just try to start all over?
    Thanks!

    The Users -> shared folder is a common ground all accounts share.

Maybe you are looking for

  • ITunes 7.1 and Norton Anti-virus do not get along!

    Sounds like Itunes 7.1 is causing hella problems for everyone out there. Add me to the list. My Itunes works, my library is there, but this update, unlike every previous update Itunes has done, is not recognized by Norton Antivirus. Every 2-3 seconds

  • Tables for Vendor Invoice (Transaction - FV60)

    Hello Experts I am trying to create a Vendor Invoice from Transaction, FV60. I am able to create it successfully.. Header Data is getting stored in the table BKPF but i can not see any entry in the transaction in BSEG. I just wanted to know that wher

  • How to include Standard Top include in custom FM ?

    Hi Experts , I have copied a standard FM to custom RFC. (and also all declarations in a custom TOP include) . I have a variable that is declared in the Standard TOP include also . How I can include that Include in my Custom RFC . This is because the

  • Need urgent help on adobe photo shop elements 12

    i recently bought adobe photo shop elemnts 12 at a local store and they told me i could use it for buisness cards to create them ..as far as i can see it does not ..and they wont let me return it so thats a 100 dollars down the drain unless someone k

  • ESS/MSS latest business packages for EP 7.0

    Hi, Installed EP 7.0 - ehp1 Need to configure the system for ESS/MSS Please guidel me for the latest business packages and navigation at Service market place Are the business packages related with ABAP system HR support package level Thanks in advanc