October 26, 2009 at 10:54 pm
how can we copy one database table to another DB table without script and insert statement?
Thanks in advance...
October 26, 2009 at 11:10 pm
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.
October 26, 2009 at 11:34 pm
You can use SSIS. Why no scripts?
"Keep Trying"
October 28, 2009 at 6:08 am
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.
October 28, 2009 at 8:29 am
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. 😎
October 28, 2009 at 8:38 am
Replication, if it's a frequent need
October 28, 2009 at 9:56 am
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.
October 28, 2009 at 10:10 am
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
October 28, 2009 at 1:56 pm
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.
October 29, 2009 at 12:23 pm
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
October 29, 2009 at 12:34 pm
"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.
October 29, 2009 at 12:46 pm
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.
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
October 29, 2009 at 12:58 pm
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.
October 29, 2009 at 1:19 pm
Even for a novice programmer, Insert into tablexyz Select Columns from tableabc should be a easier one right?
Blog -- LearnSQLWithBru
Join on Facebook Page Facebook.comLearnSQLWithBru
Twitter -- BruMedishetty
October 29, 2009 at 1:41 pm
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