Showing posts with label source. Show all posts
Showing posts with label source. Show all posts

Tuesday, March 20, 2012

Approach Help to load Data from Flatfiles into relational table where Data is coming as spaces i

Hi ,

My Input is a flat file source and it has spaces in few columns in the data . These columns are linked to another table as a foreign key and when i try loading them in a relational structure Foreigh key violation is occuring , is there a standard method to replace these spaces .

what approach should i take so that data gets loaded in a relational structure.

for example

Name Age Salary Address

dsds 23 fghghgh

Salary description level

2345 nnncncn 4

here salary is used in this example , the datatype is char in real scenario

what approach should i take to load the data in with cleansing the spaces in ssis

Assumption: You don't have any control over the structure of the destination tables, but you can add records.

To maintain your foreign key constraint, you will need to create a "salary" record that you can use where salary is not defined. EG:

Salary Description Level

9999 Not Assigned 1

Then you can use a Derived Column expression to create a new column in your dataset that uses an If expression and then write that derived column to your destination table

Like this:

Code Snippet

[Salary]=="" ? 9999 : [Salary]

This is not an optimal solution (even though it is very practical.) Ideally you should restructure your tables so:

Assumption: You can change the structure of your destination tables

In this case, you need to take the Salary column out of your destination table, and put it into another table. The relationship is that employees can have zero or one salary code. So you can create a table relating employees to salary codes with two columns (EmployeeNumber, SalaryCode) and a primary key on EmployeeCode.

(This is a drastic simplification, of course. In a real-world scenario you would probably want to track historical information too.)

|||

Thanks for the Quick reply i tried doing as you said using derived transformation and using replace function but it doesnot seem to capture the space as value in the replace expression in ssis.

Replace(salary," ",9999) it does not work it says that there might be a possibility of divide by zero error. what expression should i use here to replace the values

|||

first of all, since this is a char value, you should put quotes around the 9999.

Seond, I didn't say to use the REPLACE function, though I guess that would work, but you run the risk of having a valid id messed up by replacing a leading or trailing space with a 9999.

Also, if your Salary code was " " (eight spaces) then the REPLACE function will put in:

"99999999999999999999999999999999" which migh be too big for your destination field.

So, try using TRIM first to get ris of spaces, then ?: to replace blank with 9999.

Put this into the Expression column of Derived Value step:

Code Snippet

TRIM([SALARY])=="" ? "9999" : TRIM([Salary])

sql

Thursday, March 8, 2012

appling DTS custom transformation to replication problem (Urgent)

Hi all,
In my production environment, there is a source database that replicates
data to another server (using transactional replication).
Because of some upgrade needs, I need to change the subscriber database to
store Unicode. As a result, I want to customize the replication such that our
Big5 data in source database can be converted to UNICODE automatically during
replication.
Firstly, I want to know whether applying DTS custom transformation in
replication can solve my problem. Is there any better methods?
In addition, how can I configure DTS custom transforamtion.?
I have tried using Define Transformation of Published Data Wizard but error
occurs at the step of adding task of creating the DTS package. The error is
"SQL Server Enterprise Manager cannot complete this operation".
I also try to use DTS designer to create the package. But I cannot select
the package created bt DTS designer when I create a transformable
subscription.
Please help me
Thanks
"kazom" wrote:

> Hi all,
> In my production environment, there is a source database that replicates
> data to another server (using transactional replication).
> Because of some upgrade needs, I need to change the subscriber database to
> store Unicode. As a result, I want to customize the replication such that our
> Big5 data in source database can be converted to UNICODE automatically during
> replication.
> Firstly, I want to know whether applying DTS custom transformation in
> replication can solve my problem. Is there any better methods?
> In addition, how can I configure DTS custom transforamtion.?
> I have tried using Define Transformation of Published Data Wizard but error
> occurs at the step of adding task of creating the DTS package. The error is
> "SQL Server Enterprise Manager cannot complete this operation".
> I also try to use DTS designer to create the package. But I cannot select
> the package created bt DTS designer when I create a transformable
> subscription.
> Please help me
> Thanks
>
Hi all,
Let me make the question be more specific.
I just follow this document to configure the DTS custom transformation
replication.
But error occurs after step 11 of the part Define a DTS Package for the
Transformation
The error is:
SQL Server Enterprise Manager could not complete this operation
Both the publisher and subscripter is at the same server but different
database
The server is SQL Server 2000 service pack 4
Please help me. I really need your professional help
This is very urgent
Thanks

Application Warning

I can't find any information to correct the following warning message that I
receive in Event Viewer.
Event Type: Warning
Event Source: Microsoft Search
Event Category: Gatherer
Event ID: 3055
Description: The gatherer property mapping file cannot be opened. Error:
80070003. The default values are being used. You may have to copy the
property mapping file from the Setup CD-ROM, or reinstall the application.
Environment:
Windows 2000 Server SP4
SQL Server 2000 SP4 Standard Edition (8.00.2039)
MDAC 2.81.1117.6
The server is not in a cluster, and doesn't have Exchange installed. Any
assistance would greatly be appreciated!!!
Tom
Tom
Are you sure that it relates to SQL Server?
"Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
news:5D9BD93E-3A82-44C9-A462-EEFAF32D1250@.microsoft.com...
>I can't find any information to correct the following warning message that
>I
> receive in Event Viewer.
> Event Type: Warning
> Event Source: Microsoft Search
> Event Category: Gatherer
> Event ID: 3055
> Description: The gatherer property mapping file cannot be opened. Error:
> 80070003. The default values are being used. You may have to copy the
> property mapping file from the Setup CD-ROM, or reinstall the application.
> Environment:
> Windows 2000 Server SP4
> SQL Server 2000 SP4 Standard Edition (8.00.2039)
> MDAC 2.81.1117.6
> The server is not in a cluster, and doesn't have Exchange installed. Any
> assistance would greatly be appreciated!!!
> --
> Tom
|||Uri:
I don't really have anything else on the server besides backup software.
The only items that I've found related to this message is for Exchange and
SQL in a clustered environment. I don't have Exchange installed on this
server and I'm not running SQL in a clustered environment.
Thanks!!!
Tom
"Uri Dimant" wrote:

> Tom
> Are you sure that it relates to SQL Server?
> "Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
> news:5D9BD93E-3A82-44C9-A462-EEFAF32D1250@.microsoft.com...
>
>
|||"Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
news:6E260383-2E19-4C9C-8B3B-987293B9B57D@.microsoft.com...
> Uri:
> I don't really have anything else on the server besides backup software.
> The only items that I've found related to this message is for Exchange and
> SQL in a clustered environment. I don't have Exchange installed on this
> server and I'm not running SQL in a clustered environment.
If you search MSDN on "Gatherer", you will find that this term is a part of
other components as well. In particular, sharepoint and the Indexing
Services. There is also something called Windows Desktop Search. Also,
oblique references to outlook.
|||"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23yE7p9$BHHA.4256@.TK2MSFTNGP04.phx.gbl...
> Tom
> Are you sure that it relates to SQL Server?
Certainly looks like a Full Text Search issue.

> "Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
> news:5D9BD93E-3A82-44C9-A462-EEFAF32D1250@.microsoft.com...
>

Application Warning

I can't find any information to correct the following warning message that I
receive in Event Viewer.
Event Type: Warning
Event Source: Microsoft Search
Event Category: Gatherer
Event ID: 3055
Description: The gatherer property mapping file cannot be opened. Error:
80070003. The default values are being used. You may have to copy the
property mapping file from the Setup CD-ROM, or reinstall the application.
Environment:
Windows 2000 Server SP4
SQL Server 2000 SP4 Standard Edition (8.00.2039)
MDAC 2.81.1117.6
The server is not in a cluster, and doesn't have Exchange installed. Any
assistance would greatly be appreciated!!!
--
TomTom
Are you sure that it relates to SQL Server?
"Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
news:5D9BD93E-3A82-44C9-A462-EEFAF32D1250@.microsoft.com...
>I can't find any information to correct the following warning message that
>I
> receive in Event Viewer.
> Event Type: Warning
> Event Source: Microsoft Search
> Event Category: Gatherer
> Event ID: 3055
> Description: The gatherer property mapping file cannot be opened. Error:
> 80070003. The default values are being used. You may have to copy the
> property mapping file from the Setup CD-ROM, or reinstall the application.
> Environment:
> Windows 2000 Server SP4
> SQL Server 2000 SP4 Standard Edition (8.00.2039)
> MDAC 2.81.1117.6
> The server is not in a cluster, and doesn't have Exchange installed. Any
> assistance would greatly be appreciated!!!
> --
> Tom|||Uri:
I don't really have anything else on the server besides backup software.
The only items that I've found related to this message is for Exchange and
SQL in a clustered environment. I don't have Exchange installed on this
server and I'm not running SQL in a clustered environment.
Thanks!!!
--
Tom
"Uri Dimant" wrote:

> Tom
> Are you sure that it relates to SQL Server?
> "Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
> news:5D9BD93E-3A82-44C9-A462-EEFAF32D1250@.microsoft.com...
>
>|||"Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
news:6E260383-2E19-4C9C-8B3B-987293B9B57D@.microsoft.com...
> Uri:
> I don't really have anything else on the server besides backup software.
> The only items that I've found related to this message is for Exchange and
> SQL in a clustered environment. I don't have Exchange installed on this
> server and I'm not running SQL in a clustered environment.
If you search MSDN on "Gatherer", you will find that this term is a part of
other components as well. In particular, sharepoint and the Indexing
Services. There is also something called Windows Desktop Search. Also,
oblique references to outlook.|||"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23yE7p9$BHHA.4256@.TK2MSFTNGP04.phx.gbl...
> Tom
> Are you sure that it relates to SQL Server?
Certainly looks like a Full Text Search issue.

> "Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
> news:5D9BD93E-3A82-44C9-A462-EEFAF32D1250@.microsoft.com...
>

Application Warning

I can't find any information to correct the following warning message that I
receive in Event Viewer.
Event Type: Warning
Event Source: Microsoft Search
Event Category: Gatherer
Event ID: 3055
Description: The gatherer property mapping file cannot be opened. Error:
80070003. The default values are being used. You may have to copy the
property mapping file from the Setup CD-ROM, or reinstall the application.
Environment:
Windows 2000 Server SP4
SQL Server 2000 SP4 Standard Edition (8.00.2039)
MDAC 2.81.1117.6
The server is not in a cluster, and doesn't have Exchange installed. Any
assistance would greatly be appreciated!!!
--
TomTom
Are you sure that it relates to SQL Server?
"Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
news:5D9BD93E-3A82-44C9-A462-EEFAF32D1250@.microsoft.com...
>I can't find any information to correct the following warning message that
>I
> receive in Event Viewer.
> Event Type: Warning
> Event Source: Microsoft Search
> Event Category: Gatherer
> Event ID: 3055
> Description: The gatherer property mapping file cannot be opened. Error:
> 80070003. The default values are being used. You may have to copy the
> property mapping file from the Setup CD-ROM, or reinstall the application.
> Environment:
> Windows 2000 Server SP4
> SQL Server 2000 SP4 Standard Edition (8.00.2039)
> MDAC 2.81.1117.6
> The server is not in a cluster, and doesn't have Exchange installed. Any
> assistance would greatly be appreciated!!!
> --
> Tom|||Uri:
I don't really have anything else on the server besides backup software.
The only items that I've found related to this message is for Exchange and
SQL in a clustered environment. I don't have Exchange installed on this
server and I'm not running SQL in a clustered environment.
Thanks!!!
--
Tom
"Uri Dimant" wrote:
> Tom
> Are you sure that it relates to SQL Server?
> "Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
> news:5D9BD93E-3A82-44C9-A462-EEFAF32D1250@.microsoft.com...
> >I can't find any information to correct the following warning message that
> >I
> > receive in Event Viewer.
> > Event Type: Warning
> > Event Source: Microsoft Search
> > Event Category: Gatherer
> > Event ID: 3055
> > Description: The gatherer property mapping file cannot be opened. Error:
> > 80070003. The default values are being used. You may have to copy the
> > property mapping file from the Setup CD-ROM, or reinstall the application.
> >
> > Environment:
> > Windows 2000 Server SP4
> > SQL Server 2000 SP4 Standard Edition (8.00.2039)
> > MDAC 2.81.1117.6
> >
> > The server is not in a cluster, and doesn't have Exchange installed. Any
> > assistance would greatly be appreciated!!!
> > --
> > Tom
>
>|||"Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
news:6E260383-2E19-4C9C-8B3B-987293B9B57D@.microsoft.com...
> Uri:
> I don't really have anything else on the server besides backup software.
> The only items that I've found related to this message is for Exchange and
> SQL in a clustered environment. I don't have Exchange installed on this
> server and I'm not running SQL in a clustered environment.
If you search MSDN on "Gatherer", you will find that this term is a part of
other components as well. In particular, sharepoint and the Indexing
Services. There is also something called Windows Desktop Search. Also,
oblique references to outlook.|||"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:%23yE7p9$BHHA.4256@.TK2MSFTNGP04.phx.gbl...
> Tom
> Are you sure that it relates to SQL Server?
Certainly looks like a Full Text Search issue.
> "Tom Roth" <TomRoth@.discussions.microsoft.com> wrote in message
> news:5D9BD93E-3A82-44C9-A462-EEFAF32D1250@.microsoft.com...
>>I can't find any information to correct the following warning message that
>>I
>> receive in Event Viewer.
>> Event Type: Warning
>> Event Source: Microsoft Search
>> Event Category: Gatherer
>> Event ID: 3055
>> Description: The gatherer property mapping file cannot be opened.
>> Error:
>> 80070003. The default values are being used. You may have to copy the
>> property mapping file from the Setup CD-ROM, or reinstall the
>> application.
>> Environment:
>> Windows 2000 Server SP4
>> SQL Server 2000 SP4 Standard Edition (8.00.2039)
>> MDAC 2.81.1117.6
>> The server is not in a cluster, and doesn't have Exchange installed. Any
>> assistance would greatly be appreciated!!!
>> --
>> Tom
>

Sunday, February 19, 2012

Append Unicode string source to non-Unicode string destination

In SQL 2000 DTS, I was able to append data from an ODBC source to a SQL 2000 destination table. The destination table was created by copying an attached source table in Access to a new table, then upsizing it to SQL. The character fields come over as varchar, and that seemed to be fine with the DTS job.

Now using the same source table and the same SQL destination, only in SQL 2005 with Integration Services instead of DTS, I get an error because the connection manager interprets the source text fields as Unicode and the destination fields are varchar.

I could script the table and change the text fields in the destination table to nvarchar, but this could have adverse affect on the application that uses the destination table. Is there a way to make the connection manager see the source text fields as varchar, or have the integration package allow the append even though the destination is varchar and the source is nvarchar?

Use the Data Conversion component to change the values from DT_WSTR to DT_STR.

-Jamie

|||Thanks for the quick response. I was able to finish the SSIS package successfully.

Thursday, February 16, 2012

Append new records from ODBC source

I have created a data warehouse that pulls information from an ODBC source into a SQL database. The schema in the destination matches the source, and the packages clear the destination tables, then append all the records from the source. This is simpler than updating, appending new, and deleting on each table to get them in sync since there is no modify timestamp in the source.

There are cases where I just want to append records from the source table that do not already exist in the destination table, without clearing the destination table first.

How can this be done with a SSIS job? Also, how can the job be run from a Windows Forms application?

Steve Jensen wrote:

There are cases where I just want to append records from the source table that do not already exist in the destination table, without clearing the destination table first.

Steve,

Have you considered to use a Lookup task in your data flow to check if the row already exists in the destination table and then use the error output (no matches) for inserting only non existing rows? Notice that the error output of the lookup task needs to be set as 'redirect rows' in order to get this behavior

|||

Sounds good. Could you give me some detailed instructions for doing this?

Thanks,

Steve

|||

Steve here is a detailed description:

http://blogs.msdn.com/ashvinis/archive/2005/08/04/447859.aspx

I Hope this can help you

Rafael Salas

|||

Sorry, but I'm still at the 'first, you drag a data flow task onto the design surface ...' stage. I understand the concept but need a more step-by-step on how to do it.

Thanks,

Steve

Append new records from ODBC source

I have created a data warehouse that pulls information from an ODBC source into a SQL database. The schema in the destination matches the source, and the packages clear the destination tables, then append all the records from the source. This is simpler than updating, appending new, and deleting on each table to get them in sync since there is no modify timestamp in the source.

There are cases where I just want to append records from the source table that do not already exist in the destination table, without clearing the destination table first.

How can this be done with a SSIS job? Also, how can the job be run from a Windows Forms application?

Steve Jensen wrote:

There are cases where I just want to append records from the source table that do not already exist in the destination table, without clearing the destination table first.

Steve,

Have you considered to use a Lookup task in your data flow to check if the row already exists in the destination table and then use the error output (no matches) for inserting only non existing rows? Notice that the error output of the lookup task needs to be set as 'redirect rows' in order to get this behavior

|||

Sounds good. Could you give me some detailed instructions for doing this?

Thanks,

Steve

|||

Steve here is a detailed description:

http://blogs.msdn.com/ashvinis/archive/2005/08/04/447859.aspx

I Hope this can help you

Rafael Salas

|||

Sorry, but I'm still at the 'first, you drag a data flow task onto the design surface ...' stage. I understand the concept but need a more step-by-step on how to do it.

Thanks,

Steve

Thursday, February 9, 2012

Anyone who can help me the solve the strange problem

Hi,

i encountered a very strange problem when using SSIS, the oledb source convert some fields in retrieving the data from oracle database,the datatype of the target field is NUMBER(5,1), and all the data retrieved from it have the uniform 'x.y', and remained same when i previewed the data in the oledb source,but the output of the data changed to 'x', the data converted to integer, anyone knows how to solve the problem please let me know, thanks a lot.

Where is this output that you are looking at ? The output of the OLE DB Source?

If so, it could be that the externl columns have been mapped to the wrong pipeline types. Check this out in the OLE DB Source Advanced Editor.

-Jamie

|||Do you have anything between the source and destination that might be converting the data?|||

Jamie Thomson

thanks for your kindly help, the problem i mentioned above has been solved.

|||

icewill wrote:

Jamie Thomson

thanks for your kindly help, the problem i mentioned above has been solved.

Icewill,
I 've the same problem, question how did you solved it?
Thanks in advance.
Olaf

Anyone who can help me the solve the strange problem

Hi,

i encountered a very strange problem when using SSIS, the oledb source convert some fields in retrieving the data from oracle database,the datatype of the target field is NUMBER(5,1), and all the data retrieved from it have the uniform 'x.y', and remained same when i previewed the data in the oledb source,but the output of the data changed to 'x', the data converted to integer, anyone knows how to solve the problem please let me know, thanks a lot.

Where is this output that you are looking at ? The output of the OLE DB Source?

If so, it could be that the externl columns have been mapped to the wrong pipeline types. Check this out in the OLE DB Source Advanced Editor.

-Jamie

|||Do you have anything between the source and destination that might be converting the data?|||

Jamie Thomson

thanks for your kindly help, the problem i mentioned above has been solved.

|||

icewill wrote:

Jamie Thomson

thanks for your kindly help, the problem i mentioned above has been solved.

Icewill,
I 've the same problem, question how did you solved it?
Thanks in advance.
Olaf