How to move from one SQL Server table to another

Suppose I have two tables:
Employee1:
EmpName varchar(100)
EmpAddress varchar(200)
And
Employee2:
EmpID int,
EmpName varchar(100),
EmpAddress varchar(200)
Note: EmpID is not an identity field
How to move all the data from Employee1 table to Employee2 table with values of EmpID as 1, 2, 3, ....so on.
Can anyone have any idea?

INSERT INTO [Employee2] (EmpID, EmpName, EmpAddress)
SELECT ROW_NUMBER() OVER (ORDER BY EmpName), EmpName, EmpAddress from Employee1
should work

Similar Messages

  • Export data from MS sql server table to an oracle table

    I need to move data from a sql server table to an oracle table and when ever the sql server table is updated it needs to automatically update the oracle table. Is there procedure to do this or do I migrate the data once and set up a trigger on the sql server table to update the oracle table? If the trigger is the answer how do I do that?

    You might want to check out Oracle's heterogeneous services functionality if you haven't done so already. Here are a few links:
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/toc.htm
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14232/majfeat.htm#sthref74
    Also, consulting the Oracle streams manual may be helpful -- particularly Chapter 5.
    http://download.oracle.com/docs/cd/B19306_01/server.102/b14228/toc.htm
    Perhaps someone who is more familiar with SQL Server could provide a more helpful answer.

  • HOW TO MOVE FROM ONE JSP TO ANOTHER BY HIDING URL CHANGES

    HOW TO MOVE FROM ONE JSP TO ANOTHER BY HIDING URL CHANGES IN AN ADDRESS BAR

    Please check before posting that you have not accidentally turned on the CAPS LOCK feature of your keyboard.
    To answer your question. You can't do that. There are alterate ways to solve this sort of problem. What exactly is the nature of the problem you are seeking to solve?

  • How do i move from one I tunes store to another country if I have credit remaining

    How do i move from one I tunes store to another country if I have credit remaining

    You can't whilst you have a balance. If you can't spend it then you can try contacting iTunes support and ask them if they can remove the balance so that you can change countries : http://www.apple.com/support/itunes/contact/- click on Contact iTunes Store Support on the right-hand side of the page, then Purchases, Billing & Redemption

  • Copying more tables from a SQL Server db to another one - SSIS 2012

    Hi,
    in order to copy data of more tables (more an hundred) from a SQL Server db to a SQL Server destination db I'd like to use the Transfer SQL Server objects task, but the source tables belonged to the dbo schema and the destination schema is a different
    one.
    It seems that this task doesn't provide a such option.
    Any suggests to me, please?
    Thanks

    http://www.experts-exchange.com/Database/MS-SQL-Server/Q_26533111.html
    Best Regards,Uri Dimant SQL Server MVP,
    http://sqlblog.com/blogs/uri_dimant/
    MS SQL optimization: MS SQL Development and Optimization
    MS SQL Consulting:
    Large scale of database and data cleansing
    Remote DBA Services:
    Improves MS SQL Database Performance
    SQL Server Integration Services:
    Business Intelligence

  • How to integrate from MS SQL SERVER 2005 and Flatfile to Oracle 10g.

    Hi
    I am new to ODI. I am trying to load sample data from MS SQL Server 2005 and Flatfile to Oracle 10g.
    1. I have created three models.
    1-1. SQL2005 (SRC_CUSTOMER table)
    1-2. Flatfile (SRC_AGE_GROUP.txt & SRC_SALES_PERSON.txt)
    1-3. Oracle 10g (TRG_CUSTOMER table)
    You may know I got those environments from the ODI DEMO environment.
    2. I could able to reverse the tables also.
    3. I have created an interface which contains source table (from MSSQL 2005), Flatfile and target table from ORACLE model.
    4. I have imported the knowledge modules. But I am confusing in selecting the knowledge modules to source and target tables.
    I've selected LKM File to SQL for flatfile model.
    I've also selected LKM SQL to SQL for MSSQL 2005 model and IKM Oracle Incremental Update for the target table (ORACLE).
    I've also implemented the interface that I created. It worked without errors. But there is no data in target table which is TRG_CUSTOMER.
    I really would like to know what happened and what the problems are.
    You can email me [email protected]
    Thanks in advance
    Jason Lee

    what did give for SRC_AGE_GROUP SRC_CUSTOMER join condition
    if it is
    (SRC_CUSTOMER.AGE=SRC_AGE_GROUP.AGE_MIN) AND SRC_CUSTOMER.AGE=SRC_AGE_GROUP.AGE_MAX
    give it as
    (SRC_CUSTOMER.AGE>SRC_AGE_GROUP.AGE_MIN) AND SRC_CUSTOMER.AGE<SRC_AGE_GROUP.AGE_MAX

  • Best way to Import Data from a SQL Server Table?

    Hi,
    Firstly thanks for looking at this question.
    We need to import data into SAP BPC 5.1 on a twice daily basis and have chosen not to export to a .CSV file but instead to hold all data in a SQL table and import it directly from there.  As part of the import we wish to run the default logic, however only over the data which is imported as opposed to having to running default logic over the entire database after every import.
    We did some research on this topic and the only thing we could find that would work as described above is using the "Import SQL" package.  However we keep experiencing problems with it and have not yet been able to run it successfully; the errors it gives are not consistent from run to run which makes it difficult to start a thread, though we are getting help from the helpdesk at the moment.
    My question here though is - is there another way that someone knows of to import data into SAP BPC from a SQL table, and being able to run default logic over just the data being imported, or is our only hope getting the "Import SQL" package working?
    Any help much appreciated.
    Regards,
    Iain
    Forgot to mention details of our environment:
    SAP BPC v5.0.495, 2 server environment -
    Server 1 (DB/AS/SSIS/File server) = 64bit Windows 2k3 server with 64bit SQL Server Enterprise Edition
    Server 2 (IIS/App server) = 32bit Windows 2k3 server
    Edited by: Iain Hambleton on Jun 17, 2008 3:25 PM

    Lain,
    I recently created SSIS packages that need to work with a staging table that does all kind of manipulations of that data before it is loading into SAP BPC, because it also has to load the data in the drillthrough table within the same package. From one point in my package the data is also in a SQL table so basically the same as in your situation. This also works with an export to CSV within the DTSX file like Alwin said, because in this case you can use the standard transformation and conversion stuff during the load.
    I also needed to limit the data region for logic to the data region that is in the load for currency conversion purposes. This is not very much of a problem. I had a situation where I have an Accounts receivable cube containing a daily time dimension for keyduedates and a datasrc dimension containing weeks. Every week has a complete overview of the open AR items in that week and need to be converted for that week (datasrc) only and not for the whole database every time we load. But by default data would be converted based on the Keyduedates dimension while I wanted the Week dimension to be used as the data region. I solved it by using these rows in the logic:
    *Scope_by=version,Weeks
    *xdim_memberset weeks=%weeks_set%
    *xdim_memberset version = %version_set%
    I can send you the SSIS package and logic if you want. Just send me your details then.
    -Joost
    Edited by: Joost Hoppenbrouwers on Jun 17, 2008 4:25 PM

  • Data transfer from one sql server to another sql server in 2005

    Hi,
    Im trying to transfer only one table data from one server database  to another server   database table.both are in 2005 .Can anyone help?

    Hi,
    Im trying to transfer only one table data from one server database  to another server   database table.both are in 2005 .Can anyone help?
    If you are not using express you can use Import export wizard to mode data its very easy below link will help.In link destination is excel but you can select destination as your SQL Server
    http://www.mssqltips.com/sqlservertutorial/202/simple-way-to-export-data-from-sql-server/
    Please mark this reply as the answer or vote as helpful, as appropriate, to make it useful for other readers

  • Validations(TCode GGB0)  are client dependent how to move from one client t

    Hi All,
    I have done chabges in Validation set (Requirement from FICO Functional). As Validations are client dependent. I done the changes in 200 client now Functional want me to do these in 100 client. So Will SCC1 TCode will wrok in this case ? Or there is any other method to transport from one client to other.
    Thanks..

    Dear friend .
            SCC1 works finely in this case. You have To create request and move it to development And for production transport this request..
    regards
    Ajit

  • How to move from one transaction iView to another without losing the info.

    Hello expert,
    Is there a way to configure multiple transaction iViews in away that when I click on another iViews and want to go back to the old one, then the information is still there?  For example, we have a customize transaction that is fetched by running CM07.  I want to create two iView (CM07 and the custom transaction) in away that a user will type in the info on the CM07 iView, then click on the custom transaction iView to view the selection from CM07.  However all the information should be there when the user going back to CM07.  Right now when we are clicking from one iView to another, we have to type in the information again on CM07.
    Thank you.

    Hi ,
    See the thread below .I hope It will resolve your issue
    passing values between two transaction iviews?
    Koti Reddy
    points are welcome if it is helpful!

  • How can I from one panel access elements on another panel ?

    I have a JFrame with 2 panels and a JMenu
    I am struggling to find a way how I can access JMenu from one of my panels ...
    Also how can I access elements on one panel from other panel ? At the moment I am passing a reference from one panel to other in the constructor but it's only one way communication now ... I can't go from second panel to first ...
    I am sure there must be an elegant way to solve this problem.
    Many thanks.
    Sergei

    OK I'll give you more details...
    I have a JFrame with multiple panels...
    Also I have a JMenu on JFrame...
    Now when user clicks a button on one of the panels I need to disable a menu item ... this is issue#1
    issue#2 is:
    how do I get two panels (they are separate classes) talking to each other ??? At the moment when I initialize a panel#2 from my Frame I pass to it reference to panel#1 and in this way panel#2 can talk to panel#1 but panel#1 can't talk to panel#2 ...
    I know there must be an elegant way to solve this problem... and I don't like having 2 classes tightly coupled like this... Can I use some kind of nice OO trick for this ? I was reading about custom listeners but I don't want to go crazy on this as I don't have time... actualy I've got only 1 day to solve this issue so any help will be greatly appreciated.
    Many thanks
    Sergei

  • How to Move from One Apple ID to Another

    My wife and I use the same Apple ID on our separate iPhones.  How can she disconnect from using that ID and establish her own?

    Your wife needs to sign out of all Apple features that uses that ID and then create a new one. If you are using the same iCloud ID for backing up delete the backup before proceeding:
    http://support.apple.com/kb/HT5621

  • How to improve the updating a sql server table with another table in Oracle

    Hi there.
    I am trying to do the next updating in SSIS
    UPDATE S
    SET
    S.COLUMN_A = OT.COLUMN_A,
    S.COLUMN_B = OT.COLUMN_B
    FROM 
    SQLT1 S INNER JOIN ORACLET1  OT ON
    S. COLUMN_C = OT.COLUMN_C
    This is what I am doing:
    I am taking the Oracle data with the ODBC Source like this.
    Select column_A, column_B, column_C
    from OracleT1
    The thing is, the Oracle table has millions of registers and this updating is taking a lot. But I am not sure if it is maybe because of the design of the update query.
    I wonder is if there is another way to design this query or improve the performance of this task.
    Thanks a lot.

    Yes
    Use a OLEDB destination instead and save the records to a staging table
    Then use a subsequent Execute sql task and do the set based update in it as below
    UPDATE t
    SET COLUMN_A = s.COLUMN_A,
    COLUMN_B = s.COLUMN_B
    FROM SQLT1 t
    INNER JOIN stagingTable s
    ON s.COLUMN_C = t.COLUMN_C
    This would be much faster as its set based
    Please Mark This As Answer if it solved your issue
    Please Vote This As Helpful if it helps to solve your issue
    Visakh
    My Wiki User Page
    My MSDN Page
    My Personal Blog
    My Facebook Page

  • How to move from one page to another page

    hi all
    we have a report,in that if i click on user name he has to go to another page,
    in that page i have created one prompt and one report ,there he has to select groups(prompt) and in that page only he has to see the report
    how to provide like to page, when user clicks on user_name in the report (can we make it out navigation option in column property?)
    thanks

    hi kishore
    now i got the point ,now it is working ,
    what i did is ,i have created two pages
    page1 contains ,user_name as a prompt and one report (in this report i have given column format-->navigate to another page for the first column)
    in page2 i have created one more prompt on group_name and a report (is prompt option i have given bez when use clicks on page1 report column based on that it has to display the report)
    here my problem is,wen i returns from page2 to page1 and again i try to apply filter on the report it is not happening ,it is showing the report with old filters
    (i have again selected the value from prompt and i clicked on go button,it is not applying any filter on the report it is showing the report with older filters)
    What is the problem
    thanks
    sreedhar
    Edited by: 791907 on Oct 15, 2010 10:24 PM

  • How to move from one family plan to another within Verizon?

    My son currently is part of one family plan we have which is for non-smart phones.  It is a really old plan and a really old phone.  I also have another family plan (share everything) for my Galaxy S3 (no other people on that share everything plan yet).  Here is what I want to do:
    1) get him a new Galaxy S4 through Amazon
    2) put him on my share everything plan (share my data, and pay $40/mo for phone service)
    3) but keep his existing number.
    Is that possible?  It does not seem possible using the Amazon online system.  When I try to add another line of service on my Share Everything plan and port his number, it says not possible to port from Verizon to Verizon.  Do I have to leave Verizon and go to ATT in order to port numbers? 

    You will probably have to call customer service and get their help transferring the line between the two accounts. Are both accounts listing you as the account owner?
    If they have two different account owners you will probably have to do an Assumption of Liability instead.

Maybe you are looking for

  • Get pernr based on company code in logical databse

    Hi,     When using the get pernr event, all the pernrs that I get are in the ascending order  I want them first grouped based on the company code and then on pernr. Any suggestions would be appreciated abd suitably rewarded. for ex: get pernr.       

  • Has anyone worked in a 6K sequence?

    I am working on a project with a 6K deliverable. My media is a mix of branded material - none of which was shot at anywhere close to 6K. So my sequence is all split screens (up to 4-5 video layers with graphics and a matte window overlay). Every few

  • Is it possible in java to send a excel file (.xls) as a parameter ???????

    hey guyz iam new to java technology please tell me whether i ca send a EXCEL file(.xls) extention as a parameter to a method (later i have to create a backup file for that excel sheet) if any one know this method please give me suggestions !!! postin

  • Photostream on iPad different to iphone

    The photos that i get on my iphone are different and in a different order to what i get on my iPad.  I have recently got the new iphone 6+ and activated photo stream but have no idea why the pics are different to what i have on my iPad.  I also have

  • My camera icon has disappeared from my iphone 3gs.  What do I do?

    My camera icon has disappeared from my iphone 3gs.  How do I get it back?