Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Thursday, March 29, 2012

Finding Errors on 64bit Itanium

I have an SSIS job that is exiting with an error on a 64 bit Itanium SQL 2005 sp1. It has three parallel streams of execution. I've been running my tests using dtexec with verbose output being sent to a file.

2 of the streams execute several truncates and then are followed by 4 steps that load data from a SQL 2000 server to a SQL 2005 server. One of the job streams sources it's data using a SQL Server username/password while the other sources it's data using integrated security. Both streams use integrated security for the destinations.

The third job truncates 2 tables and then loads those two tables from an Oracle database. The oracle connections use a username/password in a connection string in a configuration database while the SQL side of the connection uses integrated security.

I've validated security is working, I've validated the drivers for Oracle are working in 64 bit mode and 32 bit mode for the connection strings I'm using, and security for the package. To top it off, this package runs to completion in 32bit mode under the same credentials.

The only warning messages I get running in verbose mode are the following warnings from the Oracle connection:

OnWarning,311-SQL-01,CHARLOTTE\!lcharlton,Import Employee Locator,{EE2C1DB7-A767-4AE6-81F4-6FAE6BFBD2CF},{DF323107-1ABD-4790-A318-B046862C6F58},10/19/2006 2:24:55 PM,10/19/2006 2:24:55 PM,-2145378202,0x,Cannot retrieve the column code page info from the OLE DB provider. If the component supports the "DefaultCodePage" property, the code page from that property will be used. Change the value of the property if the current string code page values are incorrect. If the component does not support the property, the code page from the component's locale ID will be used.

Any insights into how to troubleshoot this or possible additional steps I could take are warmly welcomed.

LarryC

The warning you see is due to the OLE DB adapter not being able to retrieve code page information from Oracle. It's a warning and does not usually terminate execution. What error message do you see when execution terminates? How did you validate that the 64-bit Oracle provider is working correctly? Did you do this by executing your package in 64-bit?

Bob

|||

There are no error messages. I've both turned on every event type and every column of information and run the dtexec in verbose mode.

To validate the connection would work in 64 bit I created a VB script using the same connection string and had it display a value from a table. While the script was running I checked the processes to validate whether that was running in *32 mode or native mode.

sql

Finding 'Error Column' Causing Error

Good Morning,

Am I new at this so please bear with me. I searched the site and found threads on identifying the meaning of an error code and have instituted that scripting. It is telling me that I have a 'The data value cannot be converted for reasons other than sign mismatch or data overflow.' error. It identifies the colum as 5301.

I searched the threads and found one telling me I could do an advanced editor search on the lineage id to find the column being referenced. I have traced the entire process using this information and cannot find a reference lineage id of 5301. Was that thread information accurate, and if so what do I do now? If not, can someone tell me how the heck I find column 5301? I cannot load my table from a flat file because of this.

Work so far:

I have checked for integrity between column definitions and source flat file. I applied derived column changes to make the data transform to the appropriate data type/order where necessary. This part works without error. (Or seems to, there is no error output from this piece.) It is only on the final attempt to load that the process errors with these messages.

Thank you in advance to anyone who can help me.

Rog

It should be, I think, the INPUT column lineage ID of the offending component.|||

Tracing input columns I can find a lineage ID of 5103 NOT 5301. There is no reference in any of the ID fields, including the lineage, of 5301. Any other ideas?

|||Edit the .dtsx package file in your favorite text editor and look for 5301. Look around there a bit to see what column it references.|||

Well it turns out that worked. The column id and lineage ID are not related at all to each other. (See below.) It would seem to me there should be a better way to find this information out than this very cumbersome process.

<inputColumn id="5301" name="" description="" lineageId="5109"

|||

CaptainMyCaptain wrote:

Well it turns out that worked. The column id and lineage ID are not related at all to each other. (See below.) It would seem to me there should be a better way to find this information out than this very cumbersome process.

<inputColumn id="5301" name="" description="" lineageId="5109"

Right, well, there is. You should be able to find the INPUT column of 5301 in your data flow when looking at the advanced editor for any given component.

The lineage ID, 5109, in this case tells me that this column has gone through some transformations along the way, but it was originally 5109 somewhere along the line. If you look back a ways, you should find an id="5109" on column further up in the .dtsx source. That is this column's "parent."

Finding Duplicates

I am trying to complete an insert from query but the problem is I have duplicates, so I'm getting an error message. So to correct it I am creating a Find Duplicates statement in the Query analyzer but Its not working can someone tell me whats wrong with this statement (by the way I'm in SQL 2000 Server)

thank you

SELECT EmployeeGamingLicense [TM#]AS [TM# Field], Count([TM#])AS NumberOfDups
FROM TERMINATION
GROUP BY [TM#]
HAVING Count([TM#])>1;
GOHey Desiree...been a while...

What's this:

EmployeeGamingLicense [TM#]AS [TM# Field],

Doesn't look like one column...how about the DDL for the TERMINATION table...

Or how about

SELECT [TM#], Count([TM#]) AS NumberOfDups
FROM TERMINATION
GROUP BY [TM#]
HAVING Count([TM#])>1|||HI BRETT!!! :) HOw ya Been?

Your right totally over looked that, thank you. Works perfect now. Got another question though, what if I wanted to find duplicate records from one table to another. I would like to be able to see if I can find matching records in two tables One is the TERMINATION.tbl the other EmployeeGamingLicense.tbl. Can I make this into a Stored procedure?

SELECT EmployeeGamingLicense.[TM#], EmployeeGamingLicense.LASTNAME, EmployeeGamingLicense.FIRSTNAME, EmployeeGamingLicense.[SSN#]
FROM EmployeeGamingLicense LEFT JOIN TERMINATION ON EmployeeGamingLicense.[TM#] = TERMINATION.[TM #]
WHERE (((TERMINATION.[TM #]) Is Not Null));|||what if I wanted to find duplicate records from one table to another. I would like to be able to see if I can find matching records in two tables...

I'd have to ask you what that means...

For example...in your previous query, you found dups...

Do you want to see the rows in the License table where you have dups in TERMINATION?

Do you want to see where you have dups because of a join between the 2?

I'm not sure...|||I'm good my statement worked I found the duplicates I needed to find. The thing is I'm Inheriting databases and I need to find the errors with them before I create the Gui for the client. Thank you Brett :)|||So you have to audit the entire db that has a poorly defined schema...

good luck

Any dates or numerics in varchar fields?

Once you clean up the dups...do you plan to put unique constarints on?|||No the dates are in (datetype: smalledatetime) and the Numbers like SSN# is in (datetype: Int) :)|||A little off topic but what do you do with SSN's that begin with 0?|||Anything that does not get math applied to it, is not a number in my book...

You want to constrain it to be numeric...that's fine...otherwise it's char or varchar|||is that ok though for them to be Int and smalldatetime, or do you suggest char or nvarchar|||I agree, we use char(9) in our db's but I've had to fight off developers that want SSN and TIN fields as int datatypes. I hate to have to determine if I need to add leading zeros back to SSN's that are int datatypes or if the SSN is truly corrupt/bad data.|||Ok this is defintely one of those learning processes I desperatley need. I love the feed back forces me to analyze the datatypes more deeply especially for future purposes. Ok so you would reccommend char instead.|||Ok Interger data consist of negative and positive whole numbers such as -15, 0, 5, and 2,509. Ok so INT base data type is a Number in the range from -2,147,483,648 through 2,147483.647 only requires 4 bytes of storage per value). Ok and char can consist of numberics, and can consist of up to 8 KB|||Dates should defenitley stay as dates...why small though?

Is space an issue?

Just a rule of thumb....

Does math need to applied? No? Then it's char or varchar...

Now here's another one...

Are you're dates nullable or not nullable?|||A little off topic but what do you do with SSN's that begin with 0?Worse yet, what do you do for the wierdo's among us with letters in their SSN?

-PatP|||What is that suppose to mean?|||No good question didnt even think about that No space is not an issue so it doesnt have to be smalldatetime can just be datetime datatype instead.

THANK YOU :)

I Love this really makes you think and plan ahead, and with database you need to plan ahead eheheh|||Is anyone as in love with BOOKS ONLINE as I am. :)
and this FORUM OF COURSE|||Just make everything nvarchar(4000) especially since space isn't an issue. That way every column is the same and easier to manage. Better yet text works well too.|||Just make everything nvarchar(4000) especially since space isn't an issue. That way every column is the same and easier to manage. Better yet text works well too.

Now Peter...|||SSNs should be char(9). Listen to Der Kaisermann.

(OK, char(11) would be a second choice...)|||SSNs should be char(9). Listen to Der Kaisermann.

(OK, char(11) would be a second choice...)If you are only storing the kind of SSN/TIN numbers used today, that might be true. If you have to store all of the SSN values, you'll need a VARCHAR(12).

For most purposes, you can get by with only the 9 digit SSN values used today, and an indicator for non-standard ones that you can then describe in more detail for the exceptions in some kind of "notes" column.

-PatP|||What is that suppose to mean?

OK, examples?...but my spider sense says you're right...

Only because peoplesoft has National Id as varchar(12)|||The commonly used SSN values today are 999-99-9999

Immigrant families, circa 1948-1952 are formatted like 999-99-9999#A9, with the first nine digits being the same for all of them.

Families of business owners, circa 1963-1965 were formatted 999-99-9999C99, with the first nine digits being the business owner's SSN.

Although rare, tax paying non-residents are formatted as either aa9-000-99-9999, 999-00-9999AA9, or a few variants. These don't follow much of any rules that I know of, although there might be some rhyme or reason under the surface.

There aren't a bunch of these "problem child" values, but there are enough that they can cause massive headaches.

Then there are the real pain-in-the-patoot types that have earned significant amounts under one of those "oddball" formats, then were given another one of the commonly used variety (999-99-9999) for "administrative convenience" and established enough earnings/etc that neither could be rescinded. Those folks have the distinction of having two active, legitimate SSNs, and may even be paying taxes on both of them at the same time! They can ball up just about anything, since even the packages that support the nonstandard formats have no real way to establish a relationship between them!

-PatP|||Wow, I had to deal with SSN's, but not in the case where a person has more than 1 at any given time... In my case every newborn is given a fake SSN (usually mother's SSN-1) until a name is given to a child (boggles my mind when a mother is carrying a baby for 9 months and at the time of birth has no idea how to call it!!!!!!)|||Pat, I do NOT want to play Trivial Pursuit with you.|||Pat, I do NOT want to play Trivial Pursuit with you.It seems like nobody wants to play with me!

I've got a bunch of great Trivial Pursuit stories. I once won a game where I went 5 for 5, then spent something like 15 turns trying to get the sports one (in a room of sports-aholics).

-PatP|||It seems like nobody wants to play with me!
-PatP

Not even the girlfreind?|||Brett, you don't play Trivial Pursuit with your girlfriend. You play Twister.|||The commonly used SSN values today are 999-99-9999

Immigrant families, circa 1948-1952 are formatted like 999-99-9999#A9, with the first nine digits being the same for all of them.

-PatP

...and here I thought it was something Canadien?!?|||No, Canadian SSNs use the metric system. Everybody knows that.|||If you are only storing the kind of SSN/TIN numbers used today, that might be true. If you have to store all of the SSN values, you'll need a VARCHAR(12).

For most purposes, you can get by with only the 9 digit SSN values used today, and an indicator for non-standard ones that you can then describe in more detail for the exceptions in some kind of "notes" column.

-PatP
I'm a bit confused. My table contains SSNs (all unique) and i've indexed the column, and is often used in WHERE clauses. It's said of that indexes shall not be created on FREE-FORM text columns (varchar usually). Some bad examples in this context are Flag column and SSN column. But since SSN's unique surely one can index it.

CHAR(12) would be better or VARCHAR(12)?

Thanx!|||What? You still here? What were we talking about, again?

Oh yeah. I remember.

"Thou Shalt Not Create Indexes On Character Fields"? I know of no such commandment. They aren't as efficient as indexes on, say, integer columns, but its still much better than not having an index on your character field.

But I'd use varchar unless you want to enforce the length of the string. That's why I originally suggested char(9) or char(11), but as Pat pointed out not ALL social security numbers are the same length.|||WHAT?

I thought you used IDENTITY Columns in every table?|||sorry to for the stupid question but what do you mean By Free-Form what is exactly is that?

Inquisitive by nature :)|||I cant believe we are still on this you guys are so funny

I love it :)|||What? Me use IDENTITY?

I NEVER use IDENTITY columns.

I'm the GUID GUY, remember?

...and by Free-form, he means that users can put whatever text they want in the field. It's not populated from a drop-down list, for instance.|||There is a hard limit to the size of an index key of just over 900 bytes. So you can not index a varchar(1000) field, if you expect to be storing values that are 1000 characters long. If all of the values happen to be less than the limit (I do not know it off hand. I know, bad DBA), then you can get away with it. Of course, the first 1000 character value to come along will hurt you bad.|||What? You still here? What were we talking about, again?

Oh yeah. I remember.

"Thou Shalt Not Create Indexes On Character Fields"? I know of no such commandment. They aren't as efficient as indexes on, say, integer columns, but its still much better than not having an index on your character field.

But I'd use varchar unless you want to enforce the length of the string. That's why I originally suggested char(9) or char(11), but as Pat pointed out not ALL social security numbers are the same length.
Sorry, bear with me plz!
Shouldn't one use an index on a column even if it's unique. SSNs are usually used in the WHERE clauses in applications(in my application just like emp.id). Users in app. access individual records on the basis on SSN. If a table has millions of records, Index Scan or Table Scan?
Stupid question, it is. but doesn't bother me. Your answer may help in clearing the concepts. :cool:|||You may get an Index Seek. But even Indes Scan is better than Table Scan in your situation, because there are much fewer index pages for SSN index of char(9) vs. data pages for your table.|||Sorry, bear with me plz!
Shouldn't one use an index on a column even if it's unique. SSNs are usually used in the WHERE clauses in applications(in my application just like emp.id). Users in app. access individual records on the basis on SSN. If a table has millions of records, Index Scan or Table Scan?
Stupid question, it is. but doesn't bother me. Your answer may help in clearing the concepts. :cool:
Well, if it's truly unique it should have a unique index or unique constraint(which creates a unique index) on the column. Check out this article about index rules in general http://www.sql-server-performance.com/optimizing_indexes.asp|||You may get an Index Seek. But even Indes Scan is better than Table Scan in your situation, because there are much fewer index pages for SSN index of char(9) vs. data pages for your table.

Getting off the floor and into my barstool...umm office chair

What?

You're not suggesting a scan is a good thing? Are you?|||You're not suggesting a scan is a good thing? Are you?An index scan versus a table scan... It could be a good thing, in relative terms.

-PatP

Friday, March 23, 2012

Find versus Select error in SQL Express.

I am trying to look up records by the first letter of the last name in SQL Express ADO recordsets.

"Select * from people where people.lastname like 'a%'"

works correctly. (a*) works also.

ptRs.movefirst

PtRs.Find "lastname LIKE 'a%'", 0, adSearchForward

Does not work, does not find anything, but if I use 'a %' ('a<space>%') it finds the first last name starting with a.

Why does a% not work. Can you not use wild characters in Find Statements in SQL Express?

Hi,

find is not a sql server statement rather than a ADO statement: http://www.devguru.com/technologies/ado/quickref/recordset_find.html

For wildcards in ADO you have to use the asteriks.

HTH, Jens Suessmeyer.

http://www.sqlserver2005.de
|||

Thanks for the ADO versus SQL, I did not understand that.

IT returns the exact same with asterix in the find?

Am I doing it wrong or missing something?

Friday, March 9, 2012

Find my Syntax Error!! (Because i cant see it)

Im getting an syntax error in the insert into statement is what my error message says, but i cant see it. So if you could take a look and maybe find the problem it would greatly help.


With addDonorReciepts
.CommandText = "insert into FoodDonations (Company, Phone, Contact Name, Street Address, Suit, City, General Location, Donor Date, Donor Time, Bakery Donated, Meat Donated, Fruit Donated, Dairy Donated, Vegetables Donated, Prepared Donated, Beverages Donated, Non-Perish Donated, Non-Food Donated, Calc1 Total, Total Donations, Receipt Number) values ('" & oneRowDon.Item(1) & "', " & oneRowDon.Item(2) & ", '" & oneRowDon.Item(3) & "', '" & oneRowDon.Item(4) & "', " & oneRowDon.Item(5) & ", '" & oneRowDon.Item(6) & "', '" & oneRowDon.Item(7) & "', " & oneRowDon.Item(8) & ", " & oneRowDon.Item(8) & ", " & oneRowDon.Item(11) & ", " & oneRowDon.Item(13) & ", " & oneRowDon.Item(14) & ", " & oneRowDon.Item(12) & ", " & oneRowDon.Item(15) & ", " & oneRowDon.Item(16) & ", " & oneRowDon.Item(19) & ", " & oneRowDon.Item(20) & ", " & oneRowDon.Item(21) & ", " & oneRowDon.Item(22) & ", " & oneRowDon.Item(22) & ", " & rNumber & ")"
.Connection = FHDB
.Connection.Open()
.ExecuteNonQuery()
.Connection.Close()
.Dispose()
End With


Item(1) - String
Item(2) - Int
Item(3) - String
Item(4) - String
Item(5) - int
Item(6) - string
Item(7) - string
Item(8) - Dunno its a DateTime thing
Item(11) - int
Item(13) - int
Item(14) - int
Item(12) - int
Item(15) - int
Item(16) - int
Item(19) - int
Item(20) - int
Item(21) - int
Item(22) - int
rNumber - int

You need to delimit all column names that have spaces. Change Contact Name to [Contact Name], etc.

A good way to debug a SQL statement that you generate is to look at the commandtext string either from debugger or by printing it out and inspecting from SQL Editor in SQL Management Studio where you get basic color coding help.

Hope this helps.

|||Aha... Thanks :)
also some of those ints were not really ints so that caused a few problems

Wednesday, March 7, 2012

Find differences in Two tables

I have a parent and a child table. When I was loading the
child table I ran into foreign key error. I need to find
the different values in the text file I am loading into
the child table (Parent table is already loaded). There
are 4 columns in the foreign key definition. I have loaded
the text data into another table(did not include the
foreign key but the indexes).
I have the following query that is taking forever in a
table with 88000 rows. Is there a quicker query (Both
tables have the necessary indexes)'.
Select * from another an
Join parent pr on
an.col1 <> pr.col1 AND an.col2 <> pr.col2
an.col3 <> pr.col3 AND an.col4 <> pr.col4
Thanks for any helpTry:
Select * from another an
left outer Join parent pr on
an.col1 = pr.col1 AND an.col2 = pr.col2
an.col3 = pr.col3 AND an.col4 = pr.col4
WHERE pr.col1 IS NULL
Unequality (<> ) is not sargeable, i.e. the Query optimizer can not use
indexes when trying to solve an unequality, but it can use indexes when
trying to solve equality operations.
Jacco Schalkwijk
SQL Server MVP
"Kavin" <anonymous@.discussions.microsoft.com> wrote in message
news:93e401c40522$eb548bb0$a101280a@.phx.gbl...
> I have a parent and a child table. When I was loading the
> child table I ran into foreign key error. I need to find
> the different values in the text file I am loading into
> the child table (Parent table is already loaded). There
> are 4 columns in the foreign key definition. I have loaded
> the text data into another table(did not include the
> foreign key but the indexes).
> I have the following query that is taking forever in a
> table with 88000 rows. Is there a quicker query (Both
> tables have the necessary indexes)'.
> Select * from another an
> Join parent pr on
> an.col1 <> pr.col1 AND an.col2 <> pr.col2
> an.col3 <> pr.col3 AND an.col4 <> pr.col4
> Thanks for any help
>|||That did it.......
Thanks.

>--Original Message--
>Try:
>Select * from another an
>left outer Join parent pr on
>an.col1 = pr.col1 AND an.col2 = pr.col2
>an.col3 = pr.col3 AND an.col4 = pr.col4
>WHERE pr.col1 IS NULL
>Unequality (<> ) is not sargeable, i.e. the Query
optimizer can not use
>indexes when trying to solve an unequality, but it can
use indexes when
>trying to solve equality operations.
>--
>Jacco Schalkwijk
>SQL Server MVP
>
>"Kavin" <anonymous@.discussions.microsoft.com> wrote in
message
>news:93e401c40522$eb548bb0$a101280a@.phx.gbl...
the
loaded
>
>.
>