Showing posts with label populate. Show all posts
Showing posts with label populate. Show all posts

Thursday, March 8, 2012

Copying data from one table to another in SQL Server

Hi,

I have two tables: 'Master' and 'Maximo'. I need to populate the sub-tables in 'Master' with the data from the equivalent sub-tables in 'Maximo'.

I'm aware that I can do this for each individual sub-table by using the Insert and Into commands and specifying the fields to populate.

However, there are 300 sub-tables which need to be populated.

Is there a batch command in SQL that would allow the easy migration of data from one table into another? The field structure is the same on both, so that should not be an issue.

I'm using Windows 2000 terminal to access the server with the databases on it. SQL Server 2000 and using MS SQL Server Enterprise manager.

Apologies if this is a really dumb question. I'm not very familiar with SQL and have rather been thrown in at the deep end with this.

Thanks in advance.Only thing i can suggest is create a dts using code such as:

"insert into <tablename>
select * from <tablename>"

once created you can re run the dts as many times as you like.|||Thanks for the suggestion. I'll give it a go.

copying data from Microsoft Access to SQL Server

Hello

I am developing a web application that will allow users to upload a .mdb file and from that file I need to populate an SQL database. I know the table name of the .mdb file, but I am unclear how to structure my data access layer correctly. How do I pull data from the .mdb file and once I have it how do i populate the SQL database?

Any advice would be greatly appreciated.


thanks!

There is one problem with moving Access data on the fly Access let people to just point and click what they wish, if that is your situation you need DTS because in SQL Server your data must be clean and relational. So if you have clean table definitions and clean inserts you could just use OpenRowset or OpenQuery. If not then DTS is your friend. So check your setup and post specifics so I can give you the resources as needed. Hope this helps.