Monday, March 26, 2012
Need help
I tried to update a record on one server and there is an update
trigger to to update another record in another server . But I got this error
and no record is updated. Can anyone please advise me the solution and the
cause? Thanks.
The error message as follow:
update action start
Server: Msg 7391, Level 16, State 1, Procedure something_ins_upd_trg, Line
328
The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the
specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransaction returned 0x8004d00a].
Hi Eric,
Welcome to use MSDN Managed Newsgroup!
From your descriptions, I understood you encounter error message 7391 when
executing query on Linked Server. If I have misunderstood your concern,
please feel free to point it out.
First of all, please make sure you are not encounter the scenario as the
following KB described.
You may receive a 7391 error message in SQL Server 2000 when you run a
distributed transaction against a linked server after you install Windows
Server 2003 or Windows XP Service Pack 2
http://support.microsoft.com/kb/839279
Also, make sure you have made MS DTC correctly configured for network access
You receive error 7391 when you run a distributed transaction against a
linked server
http://support.microsoft.com/kb/329332/en-us
Secondly, I have noticed you mentioned "there is an update trigger to to
update another record in another server". If you are executing the query
that won't active the trigger, will it also reproduce this error message?
Are you executing the stored procedure in a transtion? If you execute the
stored procedure directly, will it reproduce this error message?
If you have any questions or concerns, don't hesitate to let me know. We
are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
|||Thanks for your help, Michael. I am running this trigger on Win2000 SP3 or
SP4. If I remove the trigger there is no error at all and it does involve
store procedure. The following KB apply for Win 2003 only, right? How do
you configure the MS DTC?
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:Tk7Ahv$8FHA.1236@.TK2MSFTNGXA02.phx.gbl...
> Hi Eric,
> Welcome to use MSDN Managed Newsgroup!
> From your descriptions, I understood you encounter error message 7391 when
> executing query on Linked Server. If I have misunderstood your concern,
> please feel free to point it out.
> First of all, please make sure you are not encounter the scenario as the
> following KB described.
> You may receive a 7391 error message in SQL Server 2000 when you run a
> distributed transaction against a linked server after you install Windows
> Server 2003 or Windows XP Service Pack 2
> http://support.microsoft.com/kb/839279
> Also, make sure you have made MS DTC correctly configured for network
> access
> You receive error 7391 when you run a distributed transaction against a
> linked server
> http://support.microsoft.com/kb/329332/en-us
> Secondly, I have noticed you mentioned "there is an update trigger to to
> update another record in another server". If you are executing the query
> that won't active the trigger, will it also reproduce this error message?
> Are you executing the stored procedure in a transtion? If you execute the
> stored procedure directly, will it reproduce this error message?
> If you have any questions or concerns, don't hesitate to let me know. We
> are always here to be of assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ================================================== ===
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>
|||Hi Eric,
Thanks for your reply.
Does your two server on the same domain or on the trusted domains? Does the
linked server is also SQL Server or other database? Execute the query
directly on the destination server, will the query work and active the
trigger?
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
================================================== ===
This posting is provided "AS IS" with no warranties, and confers no rights.
Need help
I tried to update a record on one server and there is an update
trigger to to update another record in another server . But I got this error
and no record is updated. Can anyone please advise me the solution and the
cause? Thanks.
The error message as follow:
update action start
Server: Msg 7391, Level 16, State 1, Procedure something_ins_upd_trg, Line
328
The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the
specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransaction returned 0x8004d00a].Hi Eric,
Welcome to use MSDN Managed Newsgroup!
From your descriptions, I understood you encounter error message 7391 when
executing query on Linked Server. If I have misunderstood your concern,
please feel free to point it out.
First of all, please make sure you are not encounter the scenario as the
following KB described.
You may receive a 7391 error message in SQL Server 2000 when you run a
distributed transaction against a linked server after you install Windows
Server 2003 or Windows XP Service Pack 2
http://support.microsoft.com/kb/839279
Also, make sure you have made MS DTC correctly configured for network access
You receive error 7391 when you run a distributed transaction against a
linked server
http://support.microsoft.com/kb/329332/en-us
Secondly, I have noticed you mentioned "there is an update trigger to to
update another record in another server". If you are executing the query
that won't active the trigger, will it also reproduce this error message?
Are you executing the stored procedure in a transtion? If you execute the
stored procedure directly, will it reproduce this error message?
If you have any questions or concerns, don't hesitate to let me know. We
are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks for your help, Michael. I am running this trigger on Win2000 SP3 or
SP4. If I remove the trigger there is no error at all and it does involve
store procedure. The following KB apply for Win 2003 only, right? How do
you configure the MS DTC?
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:Tk7Ahv$8FHA.1236@.TK2MSFTNGXA02.phx.gbl...
> Hi Eric,
> Welcome to use MSDN Managed Newsgroup!
> From your descriptions, I understood you encounter error message 7391 when
> executing query on Linked Server. If I have misunderstood your concern,
> please feel free to point it out.
> First of all, please make sure you are not encounter the scenario as the
> following KB described.
> You may receive a 7391 error message in SQL Server 2000 when you run a
> distributed transaction against a linked server after you install Windows
> Server 2003 or Windows XP Service Pack 2
> http://support.microsoft.com/kb/839279
> Also, make sure you have made MS DTC correctly configured for network
> access
> You receive error 7391 when you run a distributed transaction against a
> linked server
> http://support.microsoft.com/kb/329332/en-us
> Secondly, I have noticed you mentioned "there is an update trigger to to
> update another record in another server". If you are executing the query
> that won't active the trigger, will it also reproduce this error message?
> Are you executing the stored procedure in a transtion? If you execute the
> stored procedure directly, will it reproduce this error message?
> If you have any questions or concerns, don't hesitate to let me know. We
> are always here to be of assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> ========================================
=============
> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>|||Hi Eric,
Thanks for your reply.
Does your two server on the same domain or on the trusted domains? Does the
linked server is also SQL Server or other database? Execute the query
directly on the destination server, will the query work and active the
trigger?
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
========================================
=============
This posting is provided "AS IS" with no warranties, and confers no rights.
Need help
I tried to update a record on one server and there is an update
trigger to to update another record in another server . But I got this error
and no record is updated. Can anyone please advise me the solution and the
cause? Thanks.
The error message as follow:
update action start
Server: Msg 7391, Level 16, State 1, Procedure something_ins_upd_trg, Line
328
The operation could not be performed because the OLE DB provider 'SQLOLEDB'
was unable to begin a distributed transaction.
[OLE/DB provider returned message: New transaction cannot enlist in the
specified transaction coordinator. ]
OLE DB error trace [OLE/DB Provider 'SQLOLEDB'
ITransactionJoin::JoinTransaction returned 0x8004d00a].Hi Eric,
Welcome to use MSDN Managed Newsgroup!
From your descriptions, I understood you encounter error message 7391 when
executing query on Linked Server. If I have misunderstood your concern,
please feel free to point it out.
First of all, please make sure you are not encounter the scenario as the
following KB described.
You may receive a 7391 error message in SQL Server 2000 when you run a
distributed transaction against a linked server after you install Windows
Server 2003 or Windows XP Service Pack 2
http://support.microsoft.com/kb/839279
Also, make sure you have made MS DTC correctly configured for network access
You receive error 7391 when you run a distributed transaction against a
linked server
http://support.microsoft.com/kb/329332/en-us
Secondly, I have noticed you mentioned "there is an update trigger to to
update another record in another server". If you are executing the query
that won't active the trigger, will it also reproduce this error message?
Are you executing the stored procedure in a transtion? If you execute the
stored procedure directly, will it reproduce this error message?
If you have any questions or concerns, don't hesitate to let me know. We
are always here to be of assistance!
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.|||Thanks for your help, Michael. I am running this trigger on Win2000 SP3 or
SP4. If I remove the trigger there is no error at all and it does involve
store procedure. The following KB apply for Win 2003 only, right? How do
you configure the MS DTC?
"Michael Cheng [MSFT]" <v-mingqc@.online.microsoft.com> wrote in message
news:Tk7Ahv$8FHA.1236@.TK2MSFTNGXA02.phx.gbl...
> Hi Eric,
> Welcome to use MSDN Managed Newsgroup!
> From your descriptions, I understood you encounter error message 7391 when
> executing query on Linked Server. If I have misunderstood your concern,
> please feel free to point it out.
> First of all, please make sure you are not encounter the scenario as the
> following KB described.
> You may receive a 7391 error message in SQL Server 2000 when you run a
> distributed transaction against a linked server after you install Windows
> Server 2003 or Windows XP Service Pack 2
> http://support.microsoft.com/kb/839279
> Also, make sure you have made MS DTC correctly configured for network
> access
> You receive error 7391 when you run a distributed transaction against a
> linked server
> http://support.microsoft.com/kb/329332/en-us
> Secondly, I have noticed you mentioned "there is an update trigger to to
> update another record in another server". If you are executing the query
> that won't active the trigger, will it also reproduce this error message?
> Are you executing the stored procedure in a transtion? If you execute the
> stored procedure directly, will it reproduce this error message?
> If you have any questions or concerns, don't hesitate to let me know. We
> are always here to be of assistance!
>
> Sincerely yours,
> Michael Cheng
> Microsoft Online Partner Support
> When responding to posts, please "Reply to Group" via your newsreader so
> that others may learn and benefit from your issue.
> =====================================================> This posting is provided "AS IS" with no warranties, and confers no
> rights.
>
>|||Hi Eric,
Thanks for your reply.
Does your two server on the same domain or on the trusted domains? Does the
linked server is also SQL Server or other database? Execute the query
directly on the destination server, will the query work and active the
trigger?
Sincerely yours,
Michael Cheng
Microsoft Online Partner Support
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
=====================================================This posting is provided "AS IS" with no warranties, and confers no rights.
Wednesday, March 21, 2012
Need basic SQL query help
The data is on a single table, 15 seperate columns. It is a table containing network router data. The existing table set up shows the historical progression of changes/updates to these routers. I am trying to determine the latest records of the routers in question. Since some of the IP addresses have been used multiple times (moved from site A to site B for example), there are multiple dupe records that I do not want.
The two fields I need to use to identify unique records are:
serial_IP and site_id
In addition to that, I would also like to know how to format "max date" query, so that I get the latest information. I can do that manually if I must via a sort when I export the data, but it would be nice to know how to do that in the future.
thanks
noclueAs those two columns make a unique key on the table, there is possibility of use of a DISTINCT keyword, such as
SELECT DISTINCT serial_IP, site_id FROM your_table;
However, regarding your next request (selecting records with the latest date), there's need to use a subquery:SELECT DISTINCT t.serial_IP, t.site_id
FROM your_table t
WHERE t.date_column = (SELECT max(t1.date_column)
FROM your_table t1
WHERE t1.serial_IP = t.serial_IP
AND t1.site_id = t.site_id
);The DISTINCT keyword might, or might not be needed in this case: if table has only one record per "date_column", you won't need that. If there are multiple records per every "date_column" value, you'll still need it to eliminate multiple records.
Monday, March 12, 2012
Need advise on Insert trigger
I am trying to create a insert trigger that gets a value from the new record and use that to get additional data from other tables and update the new record
this is howfar i came:
create trigger trUpdateGEOData
on BK_Machine
after insert
as
update BK_Machine
set BK_Machine.LOC_Street = GEO_Postcode.STraatID, BK_Machine.Loc_City = GEO_Postcode.PlaatsID
from BK_Machine join GEO_Postcode on BK_Machine.loc_postalcode = GEO_Postcode.postcode, inserted
where BK_Machine.MachineID = Inserted.MachineID and BK_Machine.Loc_Postalcode = GEO_Postcode.postcode and BK_Machine.LOC_Doornumber <= GEO_Postcode.van and
BK_Machine.LOC_Doornumber <= GEO_Postcode.tem
Trigger runs fine but doesn't do a thing probably it can't find the machineid i think,
can someone help me?
Cheers WimmoSo sorry for posting such a stupid mistake from my hazy view today!!
< should be >
Trying to get awake today, sorry for the disturbance
Cheers Wimmo|||Cleaned up your code:create trigger trUpdateGEOData
on BK_Machine
after insert
as
update BK_Machine
set BK_Machine.LOC_Street = GEO_Postcode.STraatID,
BK_Machine.Loc_City = GEO_Postcode.PlaatsID
from BK_Machine
inner join GEO_Postcode on BK_Machine.loc_postalcode = GEO_Postcode.postcode
and BK_Machine.LOC_Doornumber <= GEO_Postcode.van
and BK_Machine.LOC_Doornumber <= GEO_Postcode.tem
inner join inserted on BK_Machine.MachineID = Inserted.MachineID
Now, it strikes me that the inner join on GEO_Postcode could return no records, in which case no BK_Machine records would be updated. It could also potentially return more than one record, in which case you would get unpredictable results for your update.|||Thanx Blindman,
What do you mean with the inner join: is it when there are more records inserted at the same time with the same machineid?
Wimmo
Need advice on IF...THEN...ELSE type T-SQL syntax
I don't write SQL that often, so...
What is the most "efficient" way to write an SQL statement that accomplishes:
If a record for this key exists in this table, just update it with the following information, but if a record does not exist, create one with the information.
Thanks in advance.
Look into If Exists.
|||try this
ifexists(SELECT key_fieldfrom yourtablewhere key_field='key')BEGINUPDATE yourtableset [thefield]='your new value'WHERE key_field='key'END|||
My understanding is that with the 2008 release of sql server, it will add the MERGE command, which is designed precisely for this purpose.
Otherwise, you'll have to use the prior example (but remember to add an "else" branch to do the insert.
Alternatively, there is a way to do it as two statements (one update, one insert) that will handle all the rows you need updated/inserted.
It just depends upon the nature of the update. If all the records to be updated need to be updated with the same info (i.e., add 5% to the salary), one update statement will update all of them.
Then, do an insert statement in the form of:
insert into destination_table (col1,col2) select colA, colB from source_table where source_table.key_column not in (select key_column from destination_table)
That will insert all the missing records.
|||Thanks for the push, all. I also came upon the slightly different approach of
Do the Update, if the @.@.ROWCOUNT equals 0, do the insert.
|||
DisturbedBuddha:
Thanks for the push, all. I also came upon the slightly different approach of
Do the Update, if the @.@.ROWCOUNT equals 0, do the insert.
Duh! Much easier and probably more efficient than the exists check.
|||http://disturbedbuddha.wordpress.com/2007/11/29/easy-sql-if-record-exists-update-it-if-not-insert-it/
Friday, March 9, 2012
Need advice on best way to make dbase record updates
comma-delimited text files which I have to clean up and then import
into their MS SQL database. All last week, I was using a Cold Fusion
script to upload the cleaned up files and then import the records they
contained into the database, though obviously, the process took
friggin' forever, and could have been done 500x quicker had I done it
directly on the server. My SQL knowledge is somewhat limited, however,
so I had no choice but to stick to what I know, which is Cold Fusion
programming.
In the process of cleaning up some of these comma-delimited text files,
I inadvertently messed up some of the 10-digit zip codes, by applying
the wrong Excel formula to the ZIP columns. These records were imported
into the database with obviously incorrect zip codes (ie: single
digit). So now, I have to find the best and quickest way possible to
compare these records in the database (that have the single digit zip
codes) with the unmodified data, and to update the zip codes with the
correct data.
I've had no luck setting up a TEXT file as an ODBC datasource, -- so
I've ruled that out completely. I've also managed to import the
unmodified data into an Access database, and to set it up as a Cold
Fusion datasource. But it seems this 2nd road I've been traveling down
is not the ideal approach either.
My question is, -- assuming that I'll be able to import the records
from the Access database into their own table on the SQL server, -- how
should I go about the process of updating these records that have the
incorrect zip codes?
Here is the specific logic I would need to employ:
* Here is a list of records, each of which contains an incorrect
1-digit zip code (Database A / Table A)
* Here is a much longer list of records (which contains all of the
records from Database A / Table A + thousands more), each of which
contains a correct 5-digit zip code (Database B / Table B)
* Compare both lists of records and run the following query/update:
When a record in Database A / Table A has matching "name", "address1",
and "address2" values as a record in Database B / Table B -- update the
record in Database B / Table B with the zip code from the matching
record in Database A / Table A.
Would anyone care to write a sample query for me that I could run
directly on the SQL server, or at least give me some pointers?
The specific field names are as follows:
name,address1,address2,city,state,zip
Thanks in advance!
- yvanGive this a shot:
Here is a list of records, each of which contains an incorrect
1-digit zip code (Database A / Table A)
select name, address1, address2, zipcode
from dbA.tblA where len(zipcode) = 1 -- this will retrieve all the zip
codes records of len = 1
select count(*) from dbA.tblA where len(zipcode) = 1 -- this will give
the counts
* Here is a much longer list of records (which contains all of the
records from Database A / Table A + thousands more), each of which
contains a correct 5-digit zip code (Database B / Table B)
select A.zipcodeA, A.record, B.Record
from dbA.tblA A
INNER JOIN dbB.tblB ON
A.record = B.Record
IF you have more record of tblA in tblB then a cross join will work but
I am not clear what is your specification.
* Compare both lists of records and run the following query/update:
When a record in Database A / Table A has matching "name", "address1",
and "address2" values as a record in Database B / Table B -- update the
record in Database B / Table B with the zip code from the matching
record in Database A / Table A.
UPDATE dbB.tblB
SET zipcode = A.Zipcode
from dbB.tblB B
INNER JOIN dbA.tblA A ON
A.name = B.name and
A.address1 = B.address1 and
A.address2 = B.address2
If you will have more question let me know in my gmail account that is
sp.karma_no_spam@.gmail.com
thanks
sri
Would anyone care to write a sample query for me that I could run
directly on the SQL server, or at least give me some pointers?
The specific field names are as follows:
name,address1,address2,city,state,zip|||my email id is before the _no_s part and gmail.com
thanks
Sri|||<yvan@.ideasdesign.com> wrote in message
news:1107977508.903032.29260@.c13g2000cwb.googlegro ups.com...
<<>>
> My question is, -- assuming that I'll be able to import the records
> from the Access database into their own table on the SQL server, -- how
> should I go about the process of updating these records that have the
> incorrect zip codes?
If you are not confident with SQL then I'd suggest doing it from access.
This could be slower, but you can check what'll happen easier...
Once your sql dsn is set up, attach the table in sql.
Select new query.
Choose one of your tables.
From the query drop down menu, select update.
Add in your other table.
Create the relationships between the two tables by clicking on name in one
and dragging to name in the other.
A line will appear.
Repeat for rest.
Add your zip code and put something like [tablename].[zip] in the update
cell.
IF it matters that you exclude the ones no wrong you can detect this using
len([tablename].[zip])
as an additional column and criteria > 1
Up the top of the query window you have a drop down combo with set square
and such ( indicating design mode ).
If you choose the table thing off there then it'll show you what it'll
update.
You could temporarily add fields by double clicking.
That way you can be confident.
As I think you will see, this approach enables you to write stuff with
pretty much zero access or SQL knowledge.
Putting something together in access added future loads in with less work
seems quite possible.
Certainly, you could verify your data before loading it.
Of course if the client was to send you an access table with their data in
each time then you could create this and make the table ensure some data
integrity.
Maybe that's not an option though.
> When a record in Database A / Table A has matching "name", "address1",
> and "address2" values as a record in Database B / Table B -- update the
> record in Database B / Table B with the zip code from the matching
> record in Database A / Table A.
> Would anyone care to write a sample query for me that I could run
> directly on the SQL server, or at least give me some pointers?
> The specific field names are as follows:
> name,address1,address2,city,state,zip
> Thanks in advance!
> - yvan|||Okay, .. I've gotten a bit further on the creation of my SQL update
statement. However, I am having difficulty assigning the table name
aliases correctly.
This is what I have so far (A = messed up zips / B = correct 5-digit
zips):
UPDATE mydbase.dbo.mytable1 A
SET A.zip = LEFT(B.zip,5)
INNER JOIN mydbase.dbo.mytable2 B
ON A.name = B.name
AND A.address1 = B.address1
AND A.address2 = B.address2
WHERE A.entered = '1/21/2005'
AND A.magID = 1
AND A.scid = 0
AND (A.zip = '00000'
OR A.zip = '00001'
OR A.zip = '00002'
OR A.zip = '00003'
OR A.zip = '00004'
OR A.zip = '00005'
OR A.zip = '00006'
OR A.zip = '00007'
OR A.zip = '00008'
OR A.zip = '00009')
When I attempt to run this update statement AS IS, I get the following
error:
Server: Msg 170, Level 15, State 1, Line 1
Line 1: Incorrect syntax near 'A'.
Anyone know what the proper way to assign table name aliases is in this
scenario?
Thanks,
- yvan|||(yvan@.ideasdesign.com) writes:
> UPDATE mydbase.dbo.mytable1 A
> SET A.zip = LEFT(B.zip,5)
> INNER JOIN mydbase.dbo.mytable2 B
> ON A.name = B.name
> AND A.address1 = B.address1
> AND A.address2 = B.address2
> WHERE A.entered = '1/21/2005'
> AND A.magID = 1
> AND A.scid = 0
> AND (A.zip = '00000'
> OR A.zip = '00001'
> OR A.zip = '00002'
> OR A.zip = '00003'
> OR A.zip = '00004'
> OR A.zip = '00005'
> OR A.zip = '00006'
> OR A.zip = '00007'
> OR A.zip = '00008'
> OR A.zip = '00009')
>
> When I attempt to run this update statement AS IS, I get the following
> error:
> Server: Msg 170, Level 15, State 1, Line 1
> Line 1: Incorrect syntax near 'A'.
>
> Anyone know what the proper way to assign table name aliases is in this
> scenario?
Use a FROM clause. That's not a standard SQL thing, but a very very
handy proprietart extension to SQL.
The syntax for UPDATE is Books Online. While it may look bewildering,
it's probably more effective to read it that post questions about
syntax and wait for answers.
--
Erland Sommarskog, SQL Server MVP, esquel@.sommarskog.se
Books Online for SQL Server SP3 at
http://www.microsoft.com/sql/techin.../2000/books.asp
Wednesday, March 7, 2012
Need a list of Error Code
Hi,
When we configure a transformation to redirect the error record, SSIS gives 2 columns: 'error code' and 'error column'. In one article, I have seen how to get the error description using the 'error code'.
My questions are,
- Where I can get list of all possible error codes? 'error column' gives the id of the column. How to get the name of the 'error column'?
Thanks.
Basically you need to know the metadata of the normal output, not that easy, but simon has wrapped this up in a Tx.
http://sqljunkies.com/WebLog/simons/archive/2005/12/15/SSIS_Enhanced_Error_Component.aspx
Some related info -
http://msdn2.microsoft.com/en-us/library/ms345163.aspx
The SSIS error codes are listed in BOL. I also have them on my wiki, because BOL only got them in an update and I wanted them before that, and also you can add notes on the errors on the wiki.