Copy Table

how to copy one table from one database to another on different servers?

Hi,
You can use linked servers. Add a link server and use the following query:
select * into [target_table] from [source_server].[source_database].[dbo].[source_table]
For more information on linked servers, please refer
http://msdn.microsoft.com/en-us/library/ff772782.aspx
-Vatsalya
Vatsalya - MSFT The views and opinions expressed herein are those of the author and do not necessarily reflect the views of Microsoft.

Similar Messages

  • How can we copy table from one schema to other schema

    Hi,
    I have create one table in one schema and i want to copy it to other schema.How we can copy table from one schema to other schema

    Hi,
    You can try something like this :-
    SQL> CONNECT SYS/SYS123@SERVER AS SYSDBA
    Connected.
    SQL> CREATE USER TEST_1 IDENTIFIED BY TEST_1;
    User created.
    SQL> CREATE USER TEST_2 IDENTIFIED BY TEST_2;
    User created.
    SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_1;
    Grant succeeded.
    SQL> GRANT CONNECT,RESOURCE,DBA TO TEST_2;
    Grant succeeded.
    SQL> CONNECT TEST_1/TEST_1@SERVER
    Connected.
    SQL> CREATE TABLE TEST_COPY ( TEST_COL NUMBER );
    Table created.
    SQL> INSERT INTO TEST_COPY VALUES ( 1 );
    1 row created.
    SQL> INSERT INTO TEST_COPY VALUES ( 2 );
    1 row created.
    SQL> COMMIT;
    Commit complete.
    SQL> GRANT ALL ON TEST_COPY TO TEST_2;
    Grant succeeded.
    SQL>  CONNECT TEST_2/TEST_2@SERVER
    Connected.
    SQL> CREATE TABLE TEST_COPY AS SELECT * FROM TEST_1.TEST_COPY;
    Table created.
    SQL>  SELECT * FROM TEST_COPY;
      TEST_COL
             1
             2Regards,
    Sandeep

  • Copying table rows from one table to another table form

    Hi
    I have a problem about Copying table rows from one table to another table form.On jsf pages if you enter command button go anather jsf page and it copy one row to another table row. But when i execute this process for table FORM it doesn't copy I wrote a code under "createRowFromResultSet - overridden for custom java data source support." Code block is:
    ViewRowImpl value = super.createRowFromResultSet(qc, resultSet);
    try{
    AdfFacesContext fct = AdfFacesContext.getCurrentInstance();
    Number abc = (Number)fct.getProcessScope().get("___");
    value.setAttribute("___",abc);
    }catch(Exception ex){System.out.println(ex);  }
    return value;

    Table may be copied with the
    expdp and impdp utilities.
    http://www.oracle.com/technology/products/database/utilities/index.html

  • Copying tables in pdf's to excel in Acrobat Standard 7.0.8

    Hi there
    I am having problems copying tables of numbers from pdf's into excel in Acrobat Standard 7.0.8. I am finding that when I select data in a table, right-click, and select 'Copy As Table', only about 50% of the time will the data be pasted correctly into appropriate rows and columns in Excel. The rest of the time the all of the data is pasted into a single cell making it impossible to work with.
    I have tried various permutations of the settings under Edit > Preferences > General > Selection for 'Text Selection Margin' and 'Column Selection Margin', although have never found anything that fixes the problem.
    The unusual thing is that I used to have Acrobat version 5, in which copying data from pdf's to excel used to work *perfectly*.
    Does anyone have any suggestions about how to fix this feature in version 7? Your thoughts much appreciated. Thanks.
    LK

    It only copies correctly if you have a table that was created with the proper markup. It sounds like some of the tables you have appear to be tables, but are missing the markup. As I understand the process in the current Acrobat versions, you will not be able to create the fields correctly in that case.
    With AA5 (or maybe it was AA6), you could select a column much like selecting a graphic. That is no longer available, but would have met your need. Bill

  • Word 2010 table sytles / copying tables

    When I copy a table from one document to another the formatting does not stay the same.
    I think the problem is that the copied table adopts the paragraph style being used in the destination document. I have tried to create a table style within the destination document but when I apply the style to the table it does not change the formatting.
    The only workaround that I can think of is to create a paragraph style for the table cells and apply this to the table after it has been pasted in.
    Are there any other suggestions?
    Thanks!

    Hi nivlektech,
    Based on my understanding, you want to keep the format of table when copied to another document.
    To resolve this issue, you can choose Paste Special from Home > Clipboard > Paste Option > Keep source formatting. It preserves all original formatting of the pasted selection.
    There is an article about Paste option, hope it’s helpful.
    http://support.microsoft.com/kb/291358
    If there is anything I can do for you regarding this issue, feel free to post back.
    Best regards,
    Greta Ge
    TechNet Community Support
    It's recommended to download and install
    Configuration Analyzer Tool (OffCAT), which is developed by Microsoft Support teams. Once the tool is installed, you can run it at any time to scan for hundreds of known issues in Office
    programs.

  • How can I copy tables from Numbers to Pages without formula?

    hi everyone
    i need help
    How can I copy tables from Numbers to Pages without formula in the cells?

    Ok... I see your problem... when pasting into Pages, the formulas from Numbers are included. Perhaps this is really more of a Pages question (in which case I'm far from expert). A couple of ideas:
    • In Pages, try "Edit"/"Paste and Match Style", which may insert tab delimited cell values (no formulas). Then, if you want the table format back, select these newly pasted tabbed values and use Page's "Format"/"Table"/"Convert Text to Table"/
    • In Numbers, before copying, make a temporary table of the plain values first, then copy and paste that into Pages. To do this, select the range of cells you desire in the Numbers and "Edit"/"Copy". Then "Edit"/"Deselect All" and "Edit"/"Paste Values" and "Edit"/"Cut". Now just a table of values is on the clipboard and you can head over to Pages to paste.

  • Copy tables between two different computer?

    Hi experts,
    I don't know if is this the correct place to make this question, but I need help with independent tables. Is it possible to copy independent tables to one 6.0 computer to other computer with the same version 6.0?
    Thanks in advance for your answers,
    Best Regards,
    Rebeca

    > We want to copy independent tables from one system in 6.0 to another system in 6.0. We have system A (that was in 4.7 and now is in 6.0) with data relative to Spain and another system, system 2,  that is also in 6.0 with data from other countries. In system B we have a particular mandant for Spain and the problem is that we want to include all the independent tables information from system A to system B and we don't know how to do that... is there anyway that we can do this?
    There is no standard way of putting data of two systems to one system together. It's not just copying tables around (many HR tables are cluster tables and can't be read through SQL without a logic on top) but also speaking of dependent things.
    The only supported way of doing such things is booking an SLO service and let SAP assist you in doing it. Only then you can be sure that it works as expected. But don't underestimate the whole thing. Check
    http://service.sap.com/slo
    --> Consolidate and unite system landscapes
    --> Optimization for HCM
    SAP has the tools and the knowledge to do such things and you can be sure it works. I would not do it on my own by copying tables (most HR tables are client dependent, you'd have to map client numbers, plants, adapt T512W and all that stuff manually).
    Markus

  • Copy table from one database to another database

    Hi,
    I am new to SQL and I have a question on copying a table.
    QUE: copy one table with huge data(around 60millions of rows) from one database to another database(have to create a new table) in the same server. 

    Hi ,
    By mistake ,I understood you want to copy on different server .
    I have rectify above.On same server we can copy Table in many way ;
    As I mentioned Above you can use ;
    select * into [Destination Database].[dbo].[NewTableName] from [SourceDatabase].[dbo].[Category]
    Second;
    select * into [Destination Database].[dbo].[NewTableName] from [SourceDatabase].[dbo].[Category] Where 1=2
    Insert into [Destination Database].[dbo].[NewTableName]
    select * from [SourceDatabase].[dbo].[Category]
    Thanks

  • To copy table from one database to another

    hai,
    I will be really pleased if someone can me tell me that how can i copy table from one database to another. I am having two databases.
    Gursimran

    You can Also do
    ++ Create a database link on the TARGET to SOURCE
    CREATE PUBLIC DATABASE LINK <<DBLNK_NAME>> CONNECT TO <<USER>> IDENTIFIED BY <<PASSOWORD>> USING '<<TNS_NAME>>';
    ++ And copy as below
    CREATE TABLE EMP AS SELECT * FROM EMP@DBLNK_NAME;

  • How to copy tables between diff data source ?

    if copy tables in same datasource, the problem is easy , just
    CREATE TABLE DESTDB.TABLE as select * from SOURCEDB.TABLE
    but in diff data source, such as copy access table to a non-exsit oracle table,
    need to create the target table first . my problem is how to create the target table by source table structure. though the source table structure can be read out, but parse it and make the SQL statement to create the table is a tough job.
    anyone have good idea ??
    thanks.

    You are explaining a huge topic in simple terms.
    You are trying to do Database Migration from MS-Access to Oracle. It's not all that easy. But if you are restricting to creating few tables then, do a small exercise.
    1. Use ResultSetMetaData to get the no of coluns and their data types.
    2. Construct a create statement by using above information.
    3. Then query the table1 for all the records and insert those records into created table.
    Sudha

  • How to copy table data from onde DB to another DB using clipboard

    HI,
    i copied table data from one DB to another DB, but it displays an error as "policy with check option violation" when inserting the table data.. so how to resolve the proble.. thanks in advance.

    DECLARE
    log_utl_dir VARCHAR2(100) :=('/apps/home/cmsftp/log/gaa');
    CURSOR tb_compy_cur is
    select tb.compy_acronym
    -- QC 158113 - added below
    ,tb.ivr_plan_num
    from tb_fc_compy tb,tb_xop_entitlements te
    where tb.grant_award_accept_flag = 'Y'
    and tb.ivr_plan_num = te.ivr_plan_num
    and te.entitle_name = 'GAA_RECONCILED'
    union all
    select compy_acronym
    -- QC 158113 - added below
    ,tb.ivr_plan_num
    from tb_fc_compy tb
    where tb.res_stock_flag = 'Y'
    --and   (tb.res_auto_lapse_flag = 2 OR
    --tb.res_auto_lapse_flag = 3)
    and exists (select entitle_name from tb_xop_entitlements te
    where tb.ivr_plan_num = te.ivr_plan_num
    and te.entitle_name = 'GAA_RES_FLAG'
    and te.optionee = 'Y'
    and te.psrep = 'Y'
    and te.sponsor = 'Y'
    and te.advisor = 'Y');
    v_xopgrantz_insertcount NUMBER := 0;
    -- QC 158113 - added below
    v_xopgrantz_accpt_count NUMBER := 0;
    v_user_id VARCHAR2(30);
    insert_file_id UTL_FILE.FILE_TYPE;
    insert_log_file varchar2(45) := 'xop_grantz_insertstats.log';
    BEGIN
    DBMS_OUTPUT.PUT_LINE('success1');
    insert_file_id := UTL_FILE.fopen(log_utl_dir,insert_log_file,'w');
    UTL_FILE.put_line(insert_file_id,'Starting the Process at '|| CURRENT_TIMESTAMP);
    UTL_FILE.put_line(insert_file_id,'INSERTING ROWS FOR Companies turned on for GAA_RECONCILE and GAA/RESSTOCK');
    for compy_rec in tb_compy_cur loop
    v_user_id := 'CMS'||compy_rec.compy_acronym||'_USER';
    ctx_set_session.set_user_session(v_user_id);
    dbms_output.put_line ('success2'||''|| v_user_id);
    INSERT into xop_grantz(grant_num,
    user_id,
    last_user_id,
    restrict_grant,
    child_symbol,
    parent_grant_flag,
    bulking_overide_flag,
    exerrestrict_code,
    rounding_method,
    exercisiable_dt,
    def_res_units_flag,
    opt_gain_def_elig_flag,
    opt_gain_deferred_flag,
    opt_gain_deferred_dt,
    opts_accepted,
    lst_updtby_usercd,
    accepted_type,
    GAA_eligible,
    GAA_LST_UPDTBY)
    select g.grant_num,
    v_user_id,
    'GRNTACCPT',
    'N',
    'N',
    (sel ect code
    from tb_xop_exerrestrict_codes
    where cash_allowed = 'Y'
    and cashlesshold_allowed = 'Y'
    and cashlesssell_allowed = 'Y'
    and stockswap_allowed = 'Y'
    and restricted_allowed = 'Y'
    and sar_allowed = 'Y'
    and cashmargin_allowed = 'Y'
    and cashpartial_allowed = 'Y'
    and sarsale_allowed = 'Y'),
    NULL,
    'N',
    'N',
    'N',
    NULL,
    NULL,
    NULL,
    'N',
    NULL,
    NULL
    from grantz g
    where not exists(select 1
    from xop_grantz xg
    where xg.grant_num = g.grant_num);
    v_xopgrantz_insertcount := SQL%ROWCOUNT;
    dbms_output.put_line ('1');
    -- QC158113 - Optimisation fix--starts
    DELETE FROM gt_xop_grant_accpt_type;
    INSERT INTO gt_xop_grant_accpt_type
    SELECT g.grant_num,e.ivr_plan_num,
    pk_xop_grntaccpt.fn_get_accpt_type (v_user_id,
    g.plan_num,
    g.grant_dt,
    g.opt_num,
    g.grant_cd,
    g.plan_type,
    'Y'
    FROM grantz g,tb_xop_entitlements e
    WHERE plan_type IN (2, 4, 5, 7, 8)
    and g.user_id = v_user_id
    and e.ivr_plan_num = compy_rec.ivr_plan_num
    and entitle_name = 'GAA_RES_FLAG' ;
    dbms_output.put_line ('success3');
    v_xopgrantz_accpt_count := SQL%ROWCOUNT;
    UTL_FILE.put_line(insert_file_id,'Inserted count in gt_xop_grant_acceptance '|| v_user_id||v_xopgrantz_accpt_count);
    -- QC158113 - Optimisation fix--ends
    COMMIT;
    UTL_FILE.put_line(insert_file_id,'Inserted count in XOP_GRANTZ for USER_ID '|| v_user_id||v_xopgrantz_insertcount);
    ctx_set_session.set_user_session('');
    dbms_output.put_line ('process completed');
    end loop;
    UTL_FILE.fclose(insert_file_id);
    EXCEPTION
    when others then
    rollback;
    dbms_output.put_line ('Code '||SQLCODE||':'||SQLERRM||' at '||v_user_id||' .pr_xopgrantz_insert');
    pr_xop_log_errors('Code '||SQLCODE||':'||SQLERRM||' at '||v_user_id||' .pr_xopgrantz_insert');
    pr_xop_log_errors('Code '||SQLCODE||':'||SQLERRM||'INSERTING into xop_grantz for ALL grants');
    END;
    i received this error when running the procedure also, so the table gt_xop_grant_accpt_type is not populated
    {Code -28115:ORA-28115: policy with check option violation at CMSFB_USER .pr_xopgrantz_insert}

  • Simple:How is Copying table space from instance to other?

    Please .. Can u give me the complete way to Copy table space from instance to other using imp/exp???

    Given you didn't post a version you seem to assume there is only one way ... there are at least four I know of so you need to look up the answer for your version yourself.
    http://tahiti.oracle.com
    look up transportable tablespaces
    http://www.psoug.org/library.html
    Working demos under Transportable Tablespaces
    http://www.caleb.com
    look under the DBA scripts

  • Copying Tables in Mail and Safari

    I have a MacBook Pro with OS 10.4.7
    I have not been able to select/highlight and copy a two-dimensional (rows and columns) table from either: (1) Mac email or, (2) The web, using Safari. The copied table gets reformatted into a single column, or text format, depending on the source. Same performance when I try to forward an email containing a table.
    My solution for tables on the web is to use the composer page in Mozilla browser which works fine. But this is not available for Mac email.
    I've asked three experts at the Apple store genius bar, at various times; as well as experts in the Stanford Mac users group. All attempts to show me an approach were unsuccessful.
    I do successfully use the Mac Print Selection software for text and figures, but it does not work for tables.
    A succesful approach to copy selected two-dimensional tables will be appreciated.
    Mac Book Pro   Mac OS X (10.4.7)  

    The "table" on this web site has been prepared in HTML. You can confirm this by opening in Safari, clicking on View, and choosing View Source.
    I am not sure what you intend to do with any copy? With Mail 2.x, you could first click on Edit in Safari, Select All, and then copy (Command + C, for one way), and then while Composing an email message, click on Edit, and choose Paste as HTML. This produces a perfect copy. However, I can not assure you that every mail client that will receive such a message will handle it properly, and I can assure you that the SPAM filters that some people use through their ISP, will reject it, as they often do with any message composed of HTML.
    In addition, after selecting in Safari, and Copy, you can paste into a TextEdit document, and copy should be a faithful one. It can even respond to page size changes for changing line wraps.
    More info, please, about what you wish to do with the copied material, as far as saving.
    Ernie

  • Copying tables between schema owners

    In Timesten, can you copy tables across schemas/owners?
    i.e. OWNER_A.TABLE_Y to OWNER_B.TABLE_Y
    Where TABLE_Y has the same definition? Basically, I'd like to be able to backup one datastore and restore it in another datastore that has the same table definitions, but may have a different owner name.
    Thanks,
    Larry

    I'm not completely clear on exactly what you are looking to do. On one hand you ask about copying tables between schemas. This is easily done:
    CREATE TABLE OWNER_B.TABLE_Y AS SELECT * FROM OWNER_A.TABLE_Y;
    This only works for TimesTen tables that are not part of a cache group; specifically the source table can be part of a cache group but the target table cannot. if the target table is part of a cache group then you need to:
    1. Create the cache group containing the target (cached) table.
    2. INSERT INTO OWNER_B.TABLE_Y SELECT * FROM OWNER_A.TABLE_Y;
    But then you mention backup and restore. Since TimesTen backup/retore (ttBackup/ttRestore) works at a physical level you cannot rename/copy tables as part of that. You might be able to use ttMigrate with the -rename oldOwner:newOwner option but there are some constraints around this (one being that PL/SQL cannot be enabled in the database).
    Chris

  • Remote Client copy: Table does not exist in Nametab

    Hi!
    We executed a client copy between 2 SAP EHP4 systems.
    The both systems are SAP ERP EHP4  systems, but with different Support package.
    After the client copy we get the following errors:
    Table ADDRC_DELI_SERV  does not exist in Nametab
    Table ADDRC_DELI_SERVT  does not exist in Nametab
    Question
    How can we solve these errors, maybe to transport the tables?
    Thank you!

    Hi,
    I would suggest to synchronize support pack levels between systems and copy it again. You could try to manually define those missing tables, but you need to create them under SAP namespace. later during upgrade you'll probably get some errors. Your issue is why it's not supported by SAP. Have a look at OSS note 70547 with detailed information about client transport.
    Cheers

  • How to copy table from database in one forest to a database in a different forest?

    Hello Community
        Using Wndows 2008 Server Enterprise there exists 2 Forests,
    each containing their own SQL Server 2008 installations, a scenario exists as follows:
         a)"Domain1" resides in "Forest1" which has SQL Server 2008 containing
             a database named "Database1" which contains a table named "Table1".
         b)"Domain2" resides in "Forest2" which also has SQL Server 2008
             but containing a database named "Database2"which contains a table
             named "Table2".
        I tried to use <domain_name>.<server_name>.<owner_name>.object
    but that syntax didn't work.
        How can I copy "Table2" from "Database2" into "Database1"
    (keeping in mind the databases are in different forests and domains)?
        Thank you
        Shabeaut

    Configuring a linked server might help you
    http://social.msdn.microsoft.com/Forums/sqlserver/en-US/329709ca-349d-490d-9b42-7443caa97364/how-to-created-linked-server-between-two-different-domains?forum=sqlsecurity
    OR
    Generate the schema with data of Table1 using scripting wizard under advance setup and execute the sql file in domain2.
    -Prashanth

Maybe you are looking for