Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

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

Posted on 2009-05-08
6
Medium Priority
?
200 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
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!

 

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 2000 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

Introduction Earlier I wrote an article about the new lookup functions (http://www.experts-exchange.com/A_3433.html) that ship with SQL Server 2008 R2.  In this article I’m going to show you another new feature of SSRS 2008 R2, this time in the vis…
Use this article to create a batch file to backup a Microsoft SQL Server database to a Windows folder.  The folder can be on the local hard drive or on a network share.  This batch file will query the SQL server to get the current date & time and wi…
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…

610 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