How to Move or Copy the Tables from One Database to Another Database ?

HI,
      Can any one help me on this, How i can move or copy the tables from one database to another database in SQL server 2005 by using SQL query. Hope can anyone provide me the useful and valuable response.
Thanks
Gopi

Hello,
Maybe these links help you out
http://www.microsoft.com/downloads/en/details.aspx?familyid=56E5B1C5-BF17-42E0-A410-371A838E570A&displaylang=en
http://www.suite101.com/content/how-to-copy-a-sql-database-a193532
Also, you can just detach the database make a copy and move it to the new server.

Similar Messages

  • How do I copy the style from one control to another?

    I need to programmatically copy the style from one graph to another. I'm currently using the importstyle and export style functions but I'd like to avoid that since: 1) I'm creating >100 of the same graphs in a scrolling window and execution time is a concern, and 2) it makes it harder to redistribute the application, and 3) you shouldn't have to import/export from disk just to copy a graph style.
    I noticed the copy constructor was disabled so you can't just create a new one from the original. I suppose I could iterate through all the styles and transfer them from the master graph to all the copies but is there an easier way to do that? If not, is there some sample code for that?
    I'm using MStudio 7.0 for C
    ++.
    Thanks,
    -Bob

    One way that you could do this would be to create a helper method that configures your graph rather than configuring it at design-time, then use that helper method to apply the settings to the new graphs that you create. However, this would only work if you wanted all graphs to be configured exactly the same way - this would not work if the settings of your master graph are changing at run-time and you want the new graphs to be configured with the current settings of the master graph.
    Another approach is to query each control for IPersistPropertyBag, create an IPropertyBag, pass the IPropertyBag to the master graph's IPersistPropertyBag:ave, then pass the IPropertyBag to the new graph's IPersistPropertyBag::Load implementation. I'm not aware of any implementations of IPropertyBag that are readily available for use in applications, so the tricky part is creating the IPropertyBag. Below is a very simple implementation of IPropertyBag that should be enough to get the job done for this example. First, add this to your stdafx.h:
    #include <atlbase.h>
    CComModule _Module;
    #include <atlcom.h>
    #include <atlcoll.h>
    Here's the simple IPropertyBag implementation:
    class ATL_NO_VTABLE CSimplePropertyBag :
    public CComObjectRootEx<CComSingleThreadModel>,
    public IPropertyBag
    private:
    CAtlMap<CComBSTR, CComVariant> m_propertyMap;
    public:
    BEGIN_COM_MAP(CSimplePropertyBag)
    COM_INTERFACE_ENTRY(IPropertyBag)
    END_COM_MAP()
    STDMETHODIMP Read(LPCOLESTR pszPropName, VARIANT* pVar, IErrorLog* pErrorLog)
    HRESULT hr = E_FAIL;
    if ((pszPropName == NULL) || (pVar == NULL))
    hr = E_POINTER;
    else
    if (SUCCEEDED(::VariantClear(pVar)))
    CComBSTR key = pszPropName;
    CComVariant value;
    if (!m_propertyMap.Lookup(key, value))
    hr = E_INVALIDARG;
    else
    if (SUCCEEDED(::VariantCopy(pVar, &value)))
    hr = S_OK;
    return hr;
    STDMETHODIMP Write(LPCOLESTR pszPropName, VARIANT* pVar)
    HRESULT hr = E_FAIL;
    if ((pszPropName == NULL) || (pVar == NULL))
    hr = E_POINTER;
    else
    m_propertyMap.SetAt(pszPropName, *pVar);
    hr = S_OK;
    return hr;
    Once you have a way to create an implementation of IPropertyBag, you can use IPropertyBag and IPersistPropertyBag to copy the settings from one control to another like this:
    void CopyGraphStyle(CNiGraph& source, CNiGraph& target)
    LPUNKNOWN pSourceUnknown = source.GetControlUnknown();
    LPUNKNOWN pTargetUnknown = target.GetControlUnknown();
    if ((pSourceUnknown != NULL) && (pTargetUnknown != NULL))
    CComQIPtr<IPersistPropertyBag> pSourcePersist(pSourceUnknown);
    CComQIPtr<IPersistPropertyBag> pTargetPersist(pTargetUnknown);
    if ((pSourcePersist != NULL) && (pTargetPersist != NULL))
    CComObject<CSimplePropertyBag>* pPropertyBag = 0;
    CComObject<CSimplePropertyBag>::CreateInstance(&pPropertyBag);
    if (pPropertyBag != NULL)
    CComQIPtr<IPropertyBag> spPropertyBag(pPropertyBag);
    if (spPropertyBag != NULL)
    if (SUCCEEDED(pSourcePersist->Save(spPropertyBag, FALSE, TRUE)))
    pTargetPersist->Load(spPropertyBag, NULL);
    (Note that "CreateInstan ce" above should be CreateInstance - a space gets added for some unknown reason after I click Submit.)
    Then you can use this CopyGraphStyle method to copy the settings of the master graph to the new graph. Hope this helps.
    - Elton

  • How to move a specific tablespace datafile from one directory to another

    Database: 10.2.0.1
    OS : Generic
    Problem Description : How to move a specific tablespace datafile from one directory to another considering that the database is on Oracle Dataguard setup
    ** Oracle is working on this issue, but in parallel is opening the topic to the Community so that Community members can add their perspective, experience or knowledge. This will further enhance all knowledge bases including My Oracle Support and My Oracle Support Communities **
    Edited by: ram_orcl on 16-Aug-2010 21:21

    Dear ram_orcl,
    Please follow the procedures here;
    http://download-uk.oracle.com/docs/cd/B19306_01/server.102/b14239/manage_ps.htm#i1034172
    8.3.4 Renaming a Datafile in the Primary Database
    When you rename one or more datafiles in the primary database, the change is not propagated to the standby database. Therefore, if you want to rename the same datafiles on the standby database, you must manually make the equivalent modifications on the standby database because the modifications are not performed automatically, even if the STANDBY_FILE_MANAGEMENT initialization parameter is set to AUTO.
    The following steps describe how to rename a datafile in the primary database and manually propagate the changes to the standby database.
       1.
          To rename the datafile in the primary database, take the tablespace offline:
          SQL> ALTER TABLESPACE tbs_4 OFFLINE;
       2.
          Exit from the SQL prompt and issue an operating system command, such as the following UNIX mv command, to rename the datafile on the primary system:
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf
          /disk1/oracle/oradata/payroll/tbs_x.dbf
       3.
          Rename the datafile in the primary database and bring the tablespace back online:
          SQL> ALTER TABLESPACE tbs_4 RENAME DATAFILE      2> '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            3>  TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
          SQL> ALTER TABLESPACE tbs_4 ONLINE;
       4.
          Connect to the standby database, query the V$ARCHIVED_LOG view to verify all of the archived redo log files are applied, and then stop Redo Apply:
          SQL> SELECT SEQUENCE#,APPLIED FROM V$ARCHIVED_LOG ORDER BY SEQUENCE#;
          SEQUENCE# APP
          8 YES
          9 YES
          10 YES
          11 YES
          4 rows selected.
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE CANCEL;
       5.
          Shut down the standby database:
          SQL> SHUTDOWN;
       6.
          Rename the datafile at the standby site using an operating system command, such as the UNIX mv command:
          % mv /disk1/oracle/oradata/payroll/tbs_4.dbf /disk1/oracle/oradata/payroll/tbs_x.dbf
       7.
          Start and mount the standby database:
          SQL> STARTUP MOUNT;
       8.
          Rename the datafile in the standby control file. Note that the STANDBY_FILE_MANAGEMENT initialization parameter must be set to MANUAL.
          SQL> ALTER DATABASE RENAME FILE '/disk1/oracle/oradata/payroll/tbs_4.dbf'
            2> TO '/disk1/oracle/oradata/payroll/tbs_x.dbf';
       9.
          On the standby database, restart Redo Apply:
          SQL> ALTER DATABASE RECOVER MANAGED STANDBY DATABASE
            2> DISCONNECT FROM SESSION;
    If you do not rename the corresponding datafile at the standby system, and then try to refresh the standby database control file, the standby database will attempt to use the renamed datafile, but it will not find it. Consequently, you will see error messages similar to the following in the alert log:
    ORA-00283: recovery session canceled due to errors
    ORA-01157: cannot identify/lock datafile 4 - see DBWR trace file
    ORA-01110: datafile 4: '/Disk1/oracle/oradata/payroll/tbs_x.dbf'Hope That Helps.
    Ogan

  • Copying a table from one databse to another

    Hi,
    I used the following code to copy a table from one database to another.
    set copycommit 1
    set arraysize 1000
    copy from username/passwd@tnsname -
    create <tablename> -
    using -
    select * from <tablename>
    But I get the following error:
    set copycommit 1
    ERROR at line 1:
    ORA-00922: missing or invalid option
    Could you please let me know how this can be done.
    Thanks,
    Narasimhan

    Thanks for your suggestions.I created a database link.I had no problems.
    Then when i issue the command
    copy from uname/password@db
    create <tablename>
    using
    select * from <tablename>
    <Here db is database link to source database identified by uname and password>.
    I still get the error
    copy from uname/password@db
    ERROR at line 1:
    ORA-00900: invalid SQL statement
    Does it mean that the command is wrong?Or I'm doing something different.
    Thanks!

  • How to copy a table from one system to another system

    Hi all,
            can any one say how to copy table from one system(sys1) to another system(sys2).
    regards,
    nagaraj

    There are many ways.
    1. Use the already existing transaport request number for that table to do the transaport (Active)
    2. Create mannual transport request from SE01 and in the object list enter following
    R3TR -- TABI -- <Table Name>
    And do the transaport.
    3. Ask your basis consultant to do the transaport from oracle layer.
    Thanks,

  • How do I move or copy the contents of one tag to another ?

    No-one was able to answer my question about how I can input data into the Description tag for several tracks at once (Description not being a field listed in the Multiple Item Info window).
    So, thinking along different lines ... Comment IS a tag that is shown but I'm already using it. What I would like to do therefore is to move all the data from Comment to Description (in one go), then I can start using Comment for new data via the Multiple Item Information dialogue.
    How do I move this data from one tag to another? Is there, for example, a Doug Script to do it that anyone knows of?

    No-one was able to answer my question about how I can input data into the Description tag for several tracks at once
    -> Enter Description Text for Selected v1.1
    "This script will apply user-entered text to the "Description" tag of each of the selected tracks."
    How do I move this data from one tag to another?
    Can't find a script to do this.
    However, you can add to the Comments field and leave what is there.

  • How come when i copy a color from one page to another, the color looks faded?

    I'm using the same color in a multi-page layout. When i copy a color box from one page to another, the color looks faded on some pages. WHY?! Thanks!

    So i checked the blend spaces - both are CMYK (as this doc will be offset printed). Something really strange is happening! See attach below: the 2 blues (same setup/blend space, color breakdown, etc...) look different! And my client is PICKY! ugh. HELP! Thanks again!

  • 10g express, scheduled copy of table from one db to another

    Hi,
    I don't know much about Oracle and was hoping if someone could shed some light on how we could implement our solution.
    Our scenario is as follows:
    For a new customer we are going to have 35million records per month coming into the database.
    What we had normally been doing in MSSQL, is creating a new table every month and writing the records in here (although we never had 35 million records before).
    The problem is, I want to archive these old monthly tables in order to save space. I don't know enough about the Oracle suite to see if there is already a program that we can schedule every month to move this table from one database to another. I was initially doing it by code, but this ends up taking 3 hours to copy... something we cannot afford.
    Is 35 million records too much to hold in a table? Should we be partitioning this down even more? I don't know where the threshold is before Oracle craps out.
    Or, maybe a better idea is to create a new database and just store new entries in a new database every month... this way we won't need to copy anything. To me, this sounds stupid though as i don't want to have 60 databases kicking around in five years.
    I'm a developer and no DBA, no one here is a DBA. We're trying to evaluate if our application is going to work on a Oracle platform all without knowing anything about it. Please help!
    Thanks,
    Kevin
    Message was edited by:
    user518940

    Kevin, you definately have the right database for 35M records/mth.
    From your post, it sounds like you need to retain the records in a database for 5 years (yes?). I don't know of any size limitation for Oracle outside of the OS. I don't think your solution should be multiple databases unless you have vastly different needs for the database that can not be satisfied with one instance - ie. OLTP vs. BATCH/OLAP...
    I don't fully understand what you are shooting for because it doesn't sound like you are going to save on any space just by moving the data from one database to another, the records will still require a similar amount of space unless compressed on another database. In either case, unless you can't, I would recommend a single database design. If you need high performance querying the data, and you query it by a specified period of time - ie month, I would recommend using enterprise edition with partitioning (seperately licensed). This would allow you to create a partitioned table where you could partition the table by month. As long as you don't create unnecessary global indexes, the performance should be quite similar to querying/inserting/appending into a table just containing 1 months records. Each partition can be placed in its own tablespace/datafile(s).
    If you absolutely must 'transport' the data to another instance (which I would strongly suggest that you should load it there in the first place unless business rules, performance limitations or something else simply don't allow it), you can use 'transportable tablespaces' and simply ftp the entire datafile to another Oracle database and attach it thus avoiding having to reload it. If it's truly historical you can just leave it ReadOnly. If you want to be tricky about it, you could try to make it part of a partitoned table on the new host.
    I hope I've helped just a little bit. If you need additional help, email me directly at LenLopez AT Yahoo DOT com

  • How to pass field symbol or table from one view to another view in abap web dynpro?

    I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.

    I am creating an Inbound Outbound ALV report in ABAP Web Dynpro. However at selection-screen I have select options and fetching is done at view2. Problem is we can pass parameter using inbound outbound parameters but how to pass internal table or field-symbols from one view to another view? I made use of Assistance Class too but its not very clear to me. Please give me some example or code to sort this problem out.

  • How to copy system table from one client to another client

    Hi,
    Currently i am implementing recruitment module in one of the power sector company. I have finished all the configuration in one of the client in development server. I have trasported all the request in Qulaity server so that i can do the testing. When i am running TCode : PBA7 (Direct Data Transfer) i am getting a runtime error with error analysis -
    A SELECT, UPDATE, or DELETE statement contains the invalid table
    name "PB0021".
    I have checked this system table in this client (Quality Server) but this table is not available, but at the same time this table is available in Devepment server client where i can run this transaction.
    Requiring your help on this to resolve this issue. Do i need to copy this system table PB0021 from Development server client to Quality server client? If so then how to do this activity?
    Thanks in advance....
    Regards,
    Milind

    Hi Milind,
    Goto SE01.
    Create a workbench request manually.
    Add the following entry.
    R3TR TABL PB0021.
    Transport the request to quality system.
    Hope this works.
    Best wishes,
    Dilek

  • How to compare and copy the fields from repeating subform to another subform, same structure.

    Dear All,
    I am using LiveCycle Designer 8.2.
    I have the following requirement, and did not figure out the best way to implement it using JavaScript.
    The Form has, say, Subform A with Repeating Inner Subform, say it has the Education History of the Staff.
    I want to put another Subform B, with similar structure to From A, and create a button/function to copy the field data values from A to B.
    Subform A will show the user the fields of education with Read-Only Mode.
    Subform B will show the user the same data values with write-enable mode. This subform will allow the user update his Education Records.
    The fields are:
    0. Staff ID: Text (Key 1) (always read-only and hidden, becuase it is on the main form),
    1. Degree: Text,
    2. Specialization: Text,
    3. Institution: Text,
    4. Start Date: Date (Key 2),
    5. End Date: Date.
    Another function is needed is to compare the same records between form A and Form B.
    (Note: The Education record of a Staff has primary key of Staff ID and Start Date. Meaning, the Staff cannot have tow different degrees in starting on the same date.)
    The user may change the Institution in form B or change the Degree. I need to highlight, on Subform B, the row which was changed or added by the user. This means I need to do lookup against Subform B using the Key Values from Subform A.
    I have already developed the Form, and I have about 5 Subforms to allow updated by Staff: Education, Experience Inside the company, Experience Outside the company, Job Skills, Membership Record, ..etc. One thing I did is that the Field Names I used in Subform A are not the same of the fieldname in Subform B, but the have same suffix, and different prefix. For example, for the Education:
    Subform A - Original Values:
    1. Degree: OrgDegreet,
    2. Specialization: OrgSpecialization,
    3. Institution: OrgInistitution,
    4. Start Date: OrgDateStart (Key),
    5. End Date: OrgDateEnd.
    Subform B - Updated Values:
    1. Degree: UpdDegreet,
    2. Specialization: UpdSpecialization,
    3. Institution: UpdInistitution,
    4. Start Date: UpdDateStart (Key),
    5. End Date: UpdDateEnd.
    I understand if the Key field is updated, then it is like it was deleted, and added a new one.
    I know how to do that in ASP.NET, but need help in Adobe LiveCycle using JavaScript.
    Please help me to write these two functions, as they are very urgent requirement.
    Tarek.

    In the event Exit of the 1st subforum.invoice you will find the code to assign the value to it's "brother" on page4.
    Also, on the add button i added the code to add a record to the page4 subforum.
    To make this work you will have to copy/past the code of the exit event to all fields you want to copy and in the xfa.resolvenode("XXXXXXX[].fieldName") command replace fieldname with the actual name of the field you're at.
    I didnt't do anything to te remove line button because i don't know how you want it to work, but, if you want to control the p4 subform with the p1 subform, you shouldn't allow for lines to be removed directly in the p4 subform.
    Hope this helps.

  • How to export the table from one schema to another schema

    Hi,
    I've 2 schemas dev and test db
    And i need to copy one EMP table from DEV to TEST db in windows OS
    Could you please hint me in which schema which statement to be written ...
    Regards
    josh

    Hi,
    I am not sure I got it all. Do you have 2 schemas in 2 different databases or 2 schemas in the same database ?
    If both schemas are in one DB, you can :
    connect dev/***@DB
    grant select on emp to test;
    connect test/***@DB
    insert /*+ append */ into emp select * from dev.emp;
    commit;Or use a create table emp as select * from dev.emp; if empl table does not exist in test schema.
    If both schemas are in different DBs, you can :
    * use exp / imp tools
    * use sqlldr
    * use a database link
    Hope this helps,
    Francois

  • How to move iphoto albums or slideshows from one computer to another

    I have iphoto running both on my desktop ('08 = 7.1.5) and on my laptop ('09 = 8.1.2). The libraries contain a lot of the same images but they are not identical (and I don't want them to be). I create albums or slideshows or books on each of my machines and would like to then transfer them to the other one for keeps - without replacing the albums etc. in that library. How do I do that?
    Sorry if this is a dumb question that's been dealt with many times. I couldn't easily find an answer.

    You can move albums and their photos between libraries but not books, slideshows, cards, etc. So you will have to recreate those items in the other library.
    If you are able to get the library with the books, etc. up to speed as far as having all of the photos from the other library you can then copy that full library to the other computer so you will have the book and other keepsakes in both libraries.
    I suggest to create a separate library for the book and copy it between Macs as needed. It will be small enough to make the copying process quicker. You can add additional photos to the book library as needed from either of your other libraries.
    This tutorial may be of some help if you decide to go that route: Old Toad's Tutorial #9a - Archiving an iPhoto 7(08)/8(09) Book for Editing and/or Ordering at a Later Date.
    OT
    TIP: For insurance against the iPhoto database corruption that many users have experienced I recommend making a backup copy of the Library6.iPhoto (iPhoto.Library for iPhoto 5 and earlier versions) database file and keep it current. If problems crop up where iPhoto suddenly can't see any photos or thinks there are no photos in the library, replacing the working Library6.iPhoto file with the backup will often get the library back. By keeping it current I mean backup after each import and/or any serious editing or work on books, slideshows, calendars, cards, etc. That insures that if a problem pops up and you do need to replace the database file, you'll retain all those efforts. It doesn't take long to make the backup and it's good insurance.
    NOTE: this is not the same as routinely backing up your entire iPhoto library folder to protect your photos. It only protects the loss of your organizational efforts that the database file contains.
    I've created an Automator workflow application (requires Tiger or later), iPhoto dB File Backup, that will copy the selected Library6.iPhoto file from your iPhoto Library folder to the Pictures folder, replacing any previous version of it. There are versions that are compatible with iPhoto 5, 6, 7 and 8 libraries and Tiger and Leopard. Just put the application in the Dock and click on it whenever you want to backup the dB file. iPhoto does not have to be closed to run the application, just idle. You can download it at Toad's Cellar. Be sure to read the Read Me pdf file.
    NOTE: The new rebuild option in iPhoto 09 (v. 8.0.2), Rebuild the iPhoto Library Database from automatic backup" makes this tip obsolete.

  • How to move multi select rows(records)from one datagrid to another datagrid completelly in flex4

    hi friends,
    I  am doing mxml flex 4 wep application i am using 2 forms, each form i am using datagrid,i am struck in this place,
    my proplem is, in first form i am having a grid with 10rows and columns,i am having 10 records and one move button. Next form also having a datagrid,
    need:
    IF i am doing multi select(2records) from the first datagrid and click move button means that records will show in the second datagrid and will also delete
    from the first data grid again it wont show the records in same datagrid.
    how to do this?
    any useful suggession or snippet code.
    thanks in advance,
    Cheers,
    B.venkatesan.

    One solution could be:
    Source to data grid is an Array collection
    1.> In first data grid extraxct the rows using, grid.selecteditem
    2.>Add it to the arraycollection attached to next grid, use arraycollection addItemat api if rows needed to ve added at particular index
    3.>Use removeitemat api to remove the items from arraycollection attached to first datagrid
    4.>call invalidate on bothe of the datagrids

  • Copy the data from one column to another column using @

    I have two columns here - A and B.
    Column A has a complicated formula that will generate results. I wanted the results in Column A to be reflected in Column B without pasting the A's formula in B. This will save me the trouble of editing formulas in more than 1 column if there is a need.
    I saw somewhere that you can use "@" in column B but I have no idea how to use it.
    Assumingly column A is the first column. I tried to insert '@1' in B's formula and change B's column properties' Data Format as "Treat Text as HTML". It does not work.
    Please advise how I can do that.

    So is there any way to copy the data in Column A into Column B without putting the same formula? something like in Excel where we put "=C1". Its not possible in BI as it comes in excel.....The only way is to create a duplicate column in RPD or Answers screen and incorporate the formula and giving different name to it.
    whats the problem if you duplicate the column with same formula?....Ok still if you dont want to see identical just write some pseudo logic say
    Duplicated column f(x) case when 1=0 then column_name else formula end.....so it appears different to see but it outputs same.
    UPDATED POST
    Dont create in RPD,you can create a dummy column in that report request and change the f(x) to the above case i mentioned by taking the column from columns button in edit formula screen so when ever you edit the actual column formula that would reflect in the dummy column also as it is replicating from original one.Try and see
    hope helps you.
    Cheers,
    KK
    Edited by: Kranthi.K on Jun 2, 2011 1:26 AM

Maybe you are looking for