Showing posts with label together. Show all posts
Showing posts with label together. Show all posts

Wednesday, March 28, 2012

merge databases

I have 2 database, one has data and one is being created on my handheld. Is there a way to merge the database together so I get the data in the tables I need in the database being create or can I add tables to the existing database so I can use that for my testing?

here is the issue;

database 1 has tables with data - but does not have all the tables I need. - pre-existing

database 2 is being created when I start my app, and creates the tables I need but no data and not all the tables.

Is there a way to merge these to, so I don't have to create a huge insert statements for each tables I need data for?

or can I do a select from database 1 and insert the records into database 2?

example: insert into tbl1 (name) select database 2.table(col1) from tbl1, is this possible?

No. "Huge" insert/select/create statements are needed to do that.

|||how would I do that without creating a new database? How would I create the tables for the existing database?|||To create the tables in the existing database, use the "CREATE TABLE" statement.|||

Good day all,

I too am having the same issue. I have 2 databases with diverging information. The tables should all be identical. I've got different developers adding data to 2 different databases. Rather than re-entering data to one or the other database, I'd like to be able to merge the databases. I am by no means a SQL developer, so i'm not terribly familiar with the T-Sql commandset. If there is any more information on this subject, I will be watching this thread.

Thank you in advance for any assistance!

Friday, March 23, 2012

merge 2 columns to one?!

Hello everybody!
I′m trying to put together two columns of integer into one. They are coming from the same source table, so the "merge"-Task doesn′t work. This is what they look like:
column1: <123>
column2: <0123456>
The result should be:
merged_column: <1230123456>
Is there a task for that kind of operation or do I have to write a script? I would like do do that within the data flow.

thanks in advance! you can use SQL to concatenate these columns

select
column1
, column2
, cast(column1 as nvarchar) + cast(column2 as nvarchar) as column3
from
yourtable

how you use this depends on what you are trying to do|||

So basically you want to concatenate 2 integer columns right? You can try with the derivate column transform for that. Notice that you might need to cast them as string before concatenating them

Rafael Salas

|||Thats quite simple - I just forgot that this is possible in SQL :D
Thanks for your help!sql

merge 2 columns to one?!

Hello everybody!
I′m trying to put together two columns of integer into one. They are coming from the same source table, so the "merge"-Task doesn′t work. This is what they look like:
column1: <123>
column2: <0123456>
The result should be:
merged_column: <1230123456>
Is there a task for that kind of operation or do I have to write a script? I would like do do that within the data flow.

thanks in advance! you can use SQL to concatenate these columns

select
column1
, column2
, cast(column1 as nvarchar) + cast(column2 as nvarchar) as column3
from
yourtable

how you use this depends on what you are trying to do|||

So basically you want to concatenate 2 integer columns right? You can try with the derivate column transform for that. Notice that you might need to cast them as string before concatenating them

Rafael Salas

|||Thats quite simple - I just forgot that this is possible in SQL :D
Thanks for your help!