how can we copy one database table to another DB table?

  • how can we copy one database table to another DB table without script and insert statement?

    Thanks in advance...

  • how can we copy one database table to another DB table without script and insert statement?

    You mean you want to copy data from one DB to another.?

    Is the table already existing in the other DB.?

    You can use Export/Import feature for the same.

  • You can use SSIS. Why no scripts?

    "Keep Trying"

  • Scripts are always used, at least behind the scense. SSMS, SSIS, Import/Export, Red Gate SQL Compare/Data compare, etc...

    That's how interaction with databases work using DDL and DML.

  • You can always script the table creation, run this script on the other server and use "insert ... select * from server.schema.object. :w00t:

    It's dirty but yet another option. 😎

  • Replication, if it's a frequent need

  • Select myColumns

    Into myServer.myDatabase.myOwner.myTable

    From myTable

    It's pretty much as simple as that, other than any security you may have to be aware of that may prohibit this.

  • And yet another more costly option is to buy a 3rd party app that does data comparison (i.e. Redgate Data compare).

    However, there are so many tools readily available that have already been mentioned - SSIS, Import/Export, DTS, Bulk Copy, simple script to insert, replication (many flavors).

    I am curious though why you don't want to use a script?

    Jason...AKA CirqueDeSQLeil
    _______________________________________________
    I have given a name to my pain...MCM SQL Server, MVP
    SQL RNNR
    Posting Performance Based Questions - Gail Shaw[/url]
    Learn Extended Events

  • So, if I understand correctly, you want to "copy one database table to another DB table" without telling the system how to do it? Let me know what you find out. It will save a lot of scripting, not to mention CPU cycles.

  • You could right click and open the table using Management Studio. Click in upper most left hand corner to highlight all records and right click copy. You would then open the destination table and click in upper most left hand corner to highlight all and right click paste. There ya go no scripts no insert statement

  • "You could right click and open the table using Management Studio. Click in upper most left hand corner to highlight all records and right click copy. You would then open the destination table and click in upper most left hand corner to highlight all and right click paste. There ya go no scripts no insert statement "

    I think there probably is a record limitation using this technique. I doubt it would work if there are a million records in the table.

  • You could right click and open the table using Management Studio. Click in upper most left hand corner to highlight all records and right click copy. You would then open the destination table and click in upper most left hand corner to highlight all and right click paste. There ya go no scripts no insert statement

    I am surprised by that suggestion, is it not wild thing to do?

    May be one table and only one time that can be done what if there are multiple tables? Selecting the open Table will result in entire table and if there millions of records in the table, your server will be hit with heavy performance.

    I use the selecting the data (right clicking on the top left corner) but used it for general purpose adhoc reporting of small Data may be 20,000 or so records(from a Query resultset that I wrote). but not directly open the table especially not knowing how many rows it contains.


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • Not sure why you are surprised , we use it all the time. I agree that this is not the medthod of choice for large record counts but it still works. I was responding to the question as to "is there a way". I did not read anywhere in the question that there were a million rows in the record set. Sometimes novice users need an easy way of doing things.

  • Even for a novice programmer, Insert into tablexyz Select Columns from tableabc should be a easier one right?


    Bru Medishetty

    Blog -- LearnSQLWithBru

    Join on Facebook Page Facebook.comLearnSQLWithBru

    Twitter -- BruMedishetty

  • True,

    except it does not statisfy the requirements of the question

    the question was:

    how can we copy one database table to another DB table without script and insert statement

Viewing 15 posts - 1 through 15 (of 23 total)

You must be logged in to reply to this topic. Login to reply