Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 T-SQL OPENQUERY

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2004-12-13 : 08:21:23
Johnny writes "Hi there,

I was wondering why does my result set differ when I use an OPENQUERY() versus fully qualified table name. It seems that OPENQUERY was not returning my current data correctly.

Here is what I was doing:

1. First I updated my table with new information

2. Then running this query returned one result:
select * from [linkedservername].[databasename].[dbo].tablename where columnname like '%jmh%'

3. Then running this query returned no results:
select * from openquery(linkedservername, N'select * from tablename where columnname like ''%jmh%''')

Version, etc
Microsoft SQL Server 2000 - 8.00.760 (Intel X86)
Dec 17 2002 14:22:05
Copyright (c) 1988-2003 Microsoft Corporation
Standard Edition on Windows NT 5.2 (Build 3790: )


Thanks,

Johnny"

nr
SQLTeam MVY

12543 Posts

Posted - 2004-12-13 : 08:39:35
Different collation on the linked server?
uncommitted update not available to the new connection?

==========================================
Cursors are useful if you don't know sql.
DTS can be used in a similar way.
Beer is not cold and it isn't fizzy.
Go to Top of Page

codeaspx
Starting Member

1 Post

Posted - 2004-12-13 : 16:58:27
Hi,

Sorry for the delay in my response. I had to register, etc.

I checked both collation settings on the servers by right clicking on the database itself and viewing its properties. Both are the same. As far as update goes, it is still not clear. No connections are present at this time and the data is there. It is just when using the OPENQUERY to retrieve my records.

Is there anything related to the user requesting the data that I need to be aware of?

Thanks,

Johnny
Go to Top of Page
   

- Advertisement -