Showing posts with label schema. Show all posts
Showing posts with label schema. Show all posts

Thursday, March 29, 2012

DTS from 2 sources ??

hi
i want to load Data from 2 sources (access and mysql) the 2 source have
same schema ;how to load to cube the data and retrive the data of each
source and how configure DTS to continue from the last ID of the last
load exp :
source1 : product(id,,name)
(1,nokia 3310)
source 2 : product(id,,name)
(1,nokia 3310) ?
john1425
Posted via http://www.webservertalk.com
View this thread: http://www.webservertalk.com/message1052215.html
simply create a package where you do a lookup to get the last ID from a copy
of your table, then load the mysql database with a filter on the last ID,
then do the lookup again to get the last ID again and load the access table.
(store the lastid into a dts variable, and use it has a parameter for a
filter "select * from table where id > ?")
you'll have 1 copy of the table without duplicated IDs.
But regarding your configuration, you can directly merge information using
linked servers.
In SQL Server create 2 linked servers (1 to access 1 to mysql)
create a view like: select ... from mysql.db..table union select ... from
access...table
the union eliminate duplicated rows (but its a slow solution)
there is other solutions.
"john1425" <john1425.1orlsz@.mail.webservertalk.com> wrote in message
news:john1425.1orlsz@.mail.webservertalk.com...
> hi
> i want to load Data from 2 sources (access and mysql) the 2 source have
> same schema ;how to load to cube the data and retrive the data of each
> source and how configure DTS to continue from the last ID of the last
> load exp :
> source1 : product(id,,name)
> (1,nokia 3310)
> source 2 : product(id,,name)
> (1,nokia 3310) ?
>
> --
> john1425
> Posted via http://www.webservertalk.com
> View this thread: http://www.webservertalk.com/message1052215.html
>
sql

DTS from 2 sources ??

hi
i want to load Data from 2 sources (access and mysql) the 2 source have same
schema ;how to load to cube the data and retrive the data of each source an
d how configure DTS to continue from the last ID of the last load exp :
source1 : product(id,,name)
(1,nokia 3310)
source 2 : product(id,,name)
(1,nokia 3310) 'simply create a package where you do a lookup to get the last ID from a copy
of your table, then load the mysql database with a filter on the last ID,
then do the lookup again to get the last ID again and load the access table.
(store the lastid into a dts variable, and use it has a parameter for a
filter "select * from table where id > ?")
you'll have 1 copy of the table without duplicated IDs.
But regarding your configuration, you can directly merge information using
linked servers.
In SQL Server create 2 linked servers (1 to access 1 to mysql)
create a view like: select ... from mysql.db..table union select ... from
access...table
the union eliminate duplicated rows (but its a slow solution)
there is other solutions.
"john1425" <john1425.1orlsz@.mail.webservertalk.com> wrote in message
news:john1425.1orlsz@.mail.webservertalk.com...
> hi
> i want to load Data from 2 sources (access and mysql) the 2 source have
> same schema ;how to load to cube the data and retrive the data of each
> source and how configure DTS to continue from the last ID of the last
> load exp :
> source1 : product(id,,name)
> (1,nokia 3310)
> source 2 : product(id,,name)
> (1,nokia 3310) '
>
> --
> john1425
> ---
> Posted via http://www.webservertalk.com
> ---
> View this thread: http://www.webservertalk.com/message1052215.html
>

Wednesday, March 21, 2012

DTS -Copy tables

Hi
I have a DB2 database server.It has 2000+ tables...And I have a MS SQL database server.It has got the same tables.With same schema...
I want to take all of that tables datas to MS Sql database's tables...
I try to use DTS Import Data Wİzard but it gace an erro which is Unknown Error!!!

Now;
I try to make a DTS which is capable with doing this mission...
I want to create one DTC package and the source table and destination table names will be changed dynamically...Probably i should use ActiveX Task or Dynamic PropertTask...
Despite i have searched from net very much i couldnt find any helpfull article or sample for 3 days...I have also checked this one;
http://www.sqldts.com/default.aspx?246

But it hasnt helped me too..

I really wish thatsomebody can help me...
Thank u all

Osman AYHANpersonally...I would set up unloads from DB2...then ftp the files to the server, where I would have several jobs wake up and do bcp's or bulk inserts into the tables...after truncating them

Is there RI on the SQL server database?|||Hi brett

i dont know whatz unloads which is in DB2...
What do u mean while saying ftp files to server?Which server and which files?
Also for BCP's or Bulk inserts i need a traverse betwwen all tables to do this programatically...
And last question whatz RI?

Sorry...
I was thinking i am good at MS SQl
but after your questions i feel myself poor|||what version of DB2 and what platform?

Are you the DB2 DBA?

And are you planning on doing a full replacement of the Data from DB2?|||The Version Of the DB2 is V 8.1
And i am not DBA.I am only software engineer...
The main goal of this project is taking back up of the main ERP system which is running on DB2 to MS SQL Server...
I wrote code for this project but it runs so slowly.Becouse of DTS is one of the inner programmes of MS SQL it runs faster and faster than my programme.So I decided to use DTS.For the biggest table which contains 6million row of data it took the datas from DB2 to MS SQL in 43 minutes.And this is an already accepted time manner.
SO i think if i can write an ActiveX on DTS or whatever instead of creating 2000+ DTS package (I have nearly 2000+ table) i may write a complex DTS which will handle this..
SO this is the problem..ANd in my company here is not any MS SQl DBA or DB2 DBA...I try to handle all of this with myself...

Best Regards...

Osman AYHAN|||Brett at last i wrote an ActiveX code for getting all table names in the source database...
Do u have any idea to lighten my road;
how can i send this table names for processing at the workflow...
Probably there should be a connection for Datasource 1 for destination and a ActiveX script..
I want to pass values from ActiveX to Datasource...sql

Monday, March 19, 2012

DTS And VBScript

I have an application written in C#, which allows the user to load their destination schema (in xml format) and writer their transformation expressions either in VBScript or in T-SQL. It uses DTS to do the ETL job.

Everything works great except with one problem. If there is a hypen ("-") in any of the destination attributes, the transformation fails with syntax error. It happens only with VBScript.

Here is my transformation:

"Function Main()

DTSDestination(\"Field-1\") = #01/01/2004#

End Function"

If I replace the hypen with underscore, it works without any problem.

Does anyone have any idea about this problem?Did you try to put the field name between brackets?
[field-1]|||Tried with \"[Field-1]\" and it did not do the magic|||Perhaps a hyphen is an invalid character for a field name. Use underscores and your problem is solved. You shouldn't be using '-'s in field names, anyway.|||In general hypen ('-'s) are not allowed in a field. But if you enclose in [], it is a valid chr (atleast in SQLServer!).

As my application is a B2B application and schema is maintained by an organization, I don't have any control. Hence I can not modify the field name.

BTW, I tried the same this with Enterprise Manager, it works.

Wednesday, March 7, 2012

DTS - Oracle Schema name

Hi

I have created a very simple DTS. The DTS is used to trasfer data from Oracle to MSSQL

Eg: Select empno, empname from schemaname.employee where isactive ='Y'

I want to transfer the above data from oracle to MSSQL. I am able to create the DTS and run the DTS successfully.

Right now the schema name is harcoded. But in real scenario, the schema name is known during run time. I want to pass the schema name during run time. How to do this?

I am using Transform Data task to transfer data from oracle to mssql.

any idea?

JtamilI have never done this, but have a look at the dynamic properties task. You may be able to declare the table as a variable of some sort.|||MCrowley is right...use a dynamic variable

in your dts, right click and add a dynamic properties task
then after you declare the variable just supply it to the connections

I use dynamic variables to supply my database name
You maynot need this, but I call my dts through a bat file and i supply the values:
dtsrun /S<database> /U<user> /P<password> /N<dts name> /A sourceDB:8=cpt4

sourceDB is my dynamic variable and 'cpt4' is the value (used to point to the correct database)

When you look at the connections, one should be for your sql server data and one should be your oracle connection. Just put the created variable as the value. Then when you run it just make sure you supply the value and everything should work

DTS - import flat textfile into two separate tables

I have a report that's created each day as a flat textfile.

Because I came from the Access world, I created a macro that imports
it with a schema that gives meaningful names to the various columns,
and then uses a query to massage some of the data for me (deletes the
first blank row and does a couple of calculations)

Then I use DTS to import the Access query as a table.

the textfile has a column called "File_num", and among several others,
a column called "Serial_num". (the file numbers represent shipments,
and sometimes there are more than one serial number in the shipment,
etc., so there is a separate line for every serial number)

Naturally, I would like to split this info into two tables..one that
does not contain the serial numbers and has a primary key on the
"File_num" column, and another table that would contain just the
"File_num" and "Serial_num" columns. That way I could relate them
later...but most importantly, it will give me a table where I can use
the "File_num" as my primary key.

What would be the best way to import these two tables from one source
textfile? The other thing that gives me problems is that the text
file has no column names, and the first row is always blank.

I'm very new to SQL and DTS and would appreciate any direction.

Thanks,

Larry

- - - - - - - - - - - - - - - - - -
"Forget it, Jake. It's Chinatown.""Larry Rekow" <larry@.netgeexdotcom> wrote in message
news:3h1cj0976dtpkliussk5c1nr7jmubvt4rp@.4ax.com...
>I have a report that's created each day as a flat textfile.
> Because I came from the Access world, I created a macro that imports
> it with a schema that gives meaningful names to the various columns,
> and then uses a query to massage some of the data for me (deletes the
> first blank row and does a couple of calculations)
> Then I use DTS to import the Access query as a table.
> the textfile has a column called "File_num", and among several others,
> a column called "Serial_num". (the file numbers represent shipments,
> and sometimes there are more than one serial number in the shipment,
> etc., so there is a separate line for every serial number)
> Naturally, I would like to split this info into two tables..one that
> does not contain the serial numbers and has a primary key on the
> "File_num" column, and another table that would contain just the
> "File_num" and "Serial_num" columns. That way I could relate them
> later...but most importantly, it will give me a table where I can use
> the "File_num" as my primary key.
> What would be the best way to import these two tables from one source
> textfile? The other thing that gives me problems is that the text
> file has no column names, and the first row is always blank.
> I'm very new to SQL and DTS and would appreciate any direction.
> Thanks,
> Larry
> - - - - - - - - - - - - - - - - - -
> "Forget it, Jake. It's Chinatown."

A common technique is to import the source file directly into a staging
table, then transform the data using SQL. This is often easier than trying
to implement complex transformations in DTS itself. In your case, you could
do something like this:

insert into dbo.FileTable
(file_num, col1, col2, ...)
select file_num, col1, col2, ...
from dbo.StagingTable

insert into dbo.FileSerialTable
(file_num, serial_num)
select file_num, serial_num
from dbo.StagingTable

Simon