Showing posts with label pull. Show all posts
Showing posts with label pull. Show all posts

Tuesday, March 27, 2012

Error pulling unicode data from DB2 Linked Server

Greetings,

We have been Selecting data from A DB2 AS400 via Linked Servers in SQL 7.

We began to pull data from new intstance/tables that contain some fields with foreign characters. (double byte, unicode) Some data will pull fine, then we will get an error:

Unexpected NULL value returned for column '[MYLINKEDSERVER].[DB2NAME1].[DB2NAME2].[MYTABLENAME].DESC2' from the OLE DB provider 'MSDASQL'. This column cannot be NULL.

The DBA from the other country tells me that the field is never null.

KB article Q239458 seemed related but doesn't help. We are running SP4, and will be trying on SP3 soon.

Is there any way to turn off this checking for NULL? My guess is that it interprets the unicode as a NULL incorrectly. I've tried to explicitly cast into varchar(30.)

Sometimes this fields is readable in English and it contains data that is critical when we can see it.

Thanks In Advance,
MikeyrowThe Work-Around developed was to use a pass-thru query to the DB2. I used a NULLIF function to replace any nulls, and that prevented the OLE-DB layer from erroring and failing.

Ideally we would want the DBA in the other country to fix this themselves, but sometimes time won't allow the cogs to churn enough to get the ideal solution developed.

Mike Rowland

Error Pull replication

I have two Win2000 that are in a domain. SQL1(SQL server) acts as the
distributor and publisher. SQL2(MSDE2000) acts as the subscriber. Push merge
replication is running well.
I want to PULL the db from SQL1 to the db on SQL2, failed :The process could
not connect to Distributor. Cannot generate SSPI context.
I changed Merge Agent location from Subsciber to Distributor, message :
Server 'SQLTEST1" is not prepared to run the offloaded agent
Error Unable to activate the agent on the specified remote server because of
security restrictions. Use dcomcnfg on the remote server to allow the local
SQL Server Agent account to activate the agent
1. Where the best location for the Merge Agent
2. What I have to do next
the SSPI error should be addressed first - consult these kb articles for
more info on it.
http://support.microsoft.com/search/...alse&x=11&y=14
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Thang Long" <ThangLong@.discussions.microsoft.com> wrote in message
news:CA8EB6A7-F554-4A18-B817-6CE8F3B9A2C6@.microsoft.com...
> I have two Win2000 that are in a domain. SQL1(SQL server) acts as the
> distributor and publisher. SQL2(MSDE2000) acts as the subscriber. Push
merge
> replication is running well.
> I want to PULL the db from SQL1 to the db on SQL2, failed :The process
could
> not connect to Distributor. Cannot generate SSPI context.
> I changed Merge Agent location from Subsciber to Distributor, message :
> Server 'SQLTEST1" is not prepared to run the offloaded agent
> Error Unable to activate the agent on the specified remote server because
of
> security restrictions. Use dcomcnfg on the remote server to allow the
local
> SQL Server Agent account to activate the agent
> 1. Where the best location for the Merge Agent
> 2. What I have to do next
>
|||Thank you for the reply. Now it is running well.
One more question. I want to use dinamic filter, different database name for
each subscriber:
... WHERE CityCode = DB_NAME()
but no record in the subscriber table. Plese advice.
"Hilary Cotter" wrote:

> the SSPI error should be addressed first - consult these kb articles for
> more info on it.
> http://support.microsoft.com/search/...alse&x=11&y=14
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Thang Long" <ThangLong@.discussions.microsoft.com> wrote in message
> news:CA8EB6A7-F554-4A18-B817-6CE8F3B9A2C6@.microsoft.com...
> merge
> could
> of
> local
>
>
|||I think that db_name will always resolve to msdb - as that is the database
that the job is run in. In this case I think you will need to change your
filtering criteria.
Hilary Cotter
Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html
Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com
"Thang Long" <ThangLong@.discussions.microsoft.com> wrote in message
news:75905A3F-F21F-4131-9FDA-79D6628B79BB@.microsoft.com...
> Thank you for the reply. Now it is running well.
> One more question. I want to use dinamic filter, different database name
for[vbcol=seagreen]
> each subscriber:
> ... WHERE CityCode = DB_NAME()
> but no record in the subscriber table. Plese advice.
>
> "Hilary Cotter" wrote:
http://support.microsoft.com/search/...alse&x=11&y=14[vbcol=seagreen]
Push[vbcol=seagreen]
:[vbcol=seagreen]
because[vbcol=seagreen]
|||what should be the filter?
Please advise.
Thank you.
"Hilary Cotter" wrote:

> I think that db_name will always resolve to msdb - as that is the database
> that the job is run in. In this case I think you will need to change your
> filtering criteria.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Thang Long" <ThangLong@.discussions.microsoft.com> wrote in message
> news:75905A3F-F21F-4131-9FDA-79D6628B79BB@.microsoft.com...
> for
> http://support.microsoft.com/search/...alse&x=11&y=14
> Push
> :
> because
>
>
|||I would like to use instance name as the filtering criteria, it is posible ?
Please advice.
Thank you.
"Hilary Cotter" wrote:

> I think that db_name will always resolve to msdb - as that is the database
> that the job is run in. In this case I think you will need to change your
> filtering criteria.
> --
> Hilary Cotter
> Looking for a SQL Server replication book?
> http://www.nwsu.com/0974973602.html
> Looking for a FAQ on Indexing Services/SQL FTS
> http://www.indexserverfaq.com
> "Thang Long" <ThangLong@.discussions.microsoft.com> wrote in message
> news:75905A3F-F21F-4131-9FDA-79D6628B79BB@.microsoft.com...
> for
> http://support.microsoft.com/search/...alse&x=11&y=14
> Push
> :
> because
>
>