Thursday, October 18, 2007

Error Codes -1071607685 ((DTS_E_OLEDBDESTINATIONADAPTERSTATIC_UNAVAILABLE)) and -1071607683 (DTS_E_OLEDBDESTINATIONADAPTERSTATIC_INTEGRITYVIOLATION)

This is about Error Codes -1071607685 (DTS_E_OLEDBDESTINATIONADAPTERSTATIC_UNAVAILABLE) and -1071607683 (
DTS_E_OLEDBDESTINATIONADAPTERSTATIC_INTEGRITYVIOLATION).

These 2 codes in my experience are actually the same. I got the first while I had the Fast Load option enabled in an OLE DB Destination. I opened it and changed the Data access mode to Table or View (from Table or View - Fast Load), and then received the second error, which is actually descriptive.
The second error,
-1071607683 (DTS_E_OLEDBDESTINATIONADAPTERSTATIC_INTEGRITYVIOLATION) was caused by a foreign key constraint.

Hope this helps someone,
Rick

Thursday, October 11, 2007

Bug: RESTORE cannot process database 'database_name' because it is in use by this session.

Error:

TITLE: Microsoft SQL Server Management Studio
------------------------------

Restore failed for Server 'database_name'. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&EvtSrc=Microsoft.SqlServer.Management.Smo.ExceptionTemplates.FailedOperationExceptionText&EvtID=Restore+Server&LinkId=20476

------------------------------
ADDITIONAL INFORMATION:

System.Data.SqlClient.SqlError: RESTORE cannot process database 'database_name' because it is in use by this session. It is recommended that the master database be used when performing this operation. (Microsoft.SqlServer.Smo)

For help, click: http://go.microsoft.com/fwlink?ProdName=Microsoft+SQL+Server&ProdVer=9.00.3042.00&LinkId=20476

------------------------------
BUTTONS:

OK
------------------------------



SOLUTION:
You can't restore a DB through the SSMS interface if it's your default DB for your login! Change the login's default DB then restore.

More detailed description:
Well, there's the obvious problem that you can't restore a database you have an open connection to, but in this case the cause was less obvious. I canceled out of the restore database dialog in SSMS and check the activity monitor. There were a few open connections for the database, so I closed my connections and killed any idle connections from other users. I tried it again. Same error message.
It turns out the problem is that the database I have setup as my windows logon default DB is the same DB I was trying to restore. So when SSMS makes the connection in the background, it creates a connection to that database. I had to change the default DB in my security info, and then restore the database.
Definitely a perfect candidate for the theme of this blog: posting errors and solutions for stuff I couldn't find posted elsewhere on the net. This one's probably out there, but it's not easy to find via a search engine, so hopefully this helped.

Wednesday, October 10, 2007

Error: 0xC0047072 at Import to DTS.Pipeline: No object exists with the ID

I just received this error when attempting to run an SSIS package I had modified. I (mis!)interpreted the error as a failed lookup, and made all kinds of changes to the package in attempts to prove that in fact there were no failed lookups, and wondering why it hadn't redirected the errors like I had told it to.

[Big Edit]
There used to be something here about how this was caused by copy/pasting the lookup transforms, but that has nothing to do with it. I can reproduce this without the copy/pasting. It's because I have more than one lookup transform referencing the same table. Once I disabled memory caching for those lookups sharing the same data, the problem went away.

I really think this is a bug. That is NOT the error message that should be shown for that situation.