Solved

Using Linked Server in SSRS 2000 Reports( Linked Server Query returns NULL)

Posted on 2009-05-08
6
198 Views
Last Modified: 2012-05-06
Hi there:
  I have a query which requires the liked server in sql server . Below is the query.
However,it always returns NULL data...

Anyone has seen this before?

 thanks

 Hui


select ps_tbl.DESCR from PSDB..SYSADM.PS_PRODUCT_TBL ps_tbl 
where ps_tbl.PRODUCT = ' substring(ccontl.gl_type_id,7,4)'

Open in new window

0
Comment
Question by:HuiShi
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24338005
select ps_tbl.DESCR
from PSDB..SYSADM.PS_PRODUCT_TBL ps_tbl
where ps_tbl.PRODUCT =  substring(ccontl.gl_type_id,7,4)   --- no quotes here
0
 

Author Comment

by:HuiShi
ID: 24338111
Thanks.  I got  the following error after putting the modified Clause

Can not resolve teh collation confliect between
"SQL_LATIN1_GENERAL_CP1_CS_AS"  and
"SQL_LATIN1_GENERAL_CP1_CI_AS" IN the equal to operation

any idea about that?

thanks
0
 
LVL 75

Expert Comment

by:Aneesh Retnakaran
ID: 24338201

select ps_tbl.DESCR
from PSDB..SYSADM.PS_PRODUCT_TBL ps_tbl
where ps_tbl.PRODUCT COLLATE SQL_LATIN1_GENERAL_CP1_CS_AS = substring(ccontl.gl_type_id,7,4) COLLATE SQL_LATIN1_GENERAL_CP1_CS_AS
0
Three Reasons Why Backup is Strategic

Backup is strategic to your business because your data is strategic to your business. Without backup, your business will fail. This white paper explains why it is vital for you to design and immediately execute a backup strategy to protect 100 percent of your data.

 

Author Comment

by:HuiShi
ID: 24338428
thanks, it works. Can you tell why it's working? also why do I need to punch the
COLLATE SQL_LATIN1_GENERAL_CP1_CS_AS?

Hui
0
 
LVL 75

Accepted Solution

by:
Aneesh Retnakaran earned 500 total points
ID: 24338464
the columns in the where clause have different collations, thats why you were getting the error. and the COLLATE function just convert a column /value into a different collation
0
 

Author Closing Comment

by:HuiShi
ID: 31579537
Thanks!
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…
Monitoring a network: why having a policy is the best policy? Michael Kulchisky, MCSE, MCSA, MCP, VTSP, VSP, CCSP outlines the enormous benefits of having a policy-based approach when monitoring medium and large networks. Software utilized in this v…

690 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question