Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Linked Table Not Returning All Data

Status
Not open for further replies.

mwolf00

Programmer
Nov 5, 2001
4,177
US
I'm working on a stored procedure that pulls data from a Sybase table via a linked server. When I write a direct query like
Code:
select * from sybServ.dbo.table1 where field like 'VA008%'
I get no result. I do get a result if I broaden the search but I still don't get records above 'VA007%'

However if I use openQuery like
Code:
SELECT * FROM openQuery(sybServ,'select * from table1 where field like ''VA008%''')
I get what I need. Any ideas as to why?

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
yep, your sybase odbc driver isn't doing a very good job using openquery wiil prevent that from happening since it transfers the sql statement directly to the sybase server. BTW din't sqlserver used to be sybase.
BTW2 linked server aren't fun (I won't use any nasty words in here)

Christiaan Baes
Belgium

"My new site" - Me
 
chrissie1 said:
BTW2 linked server aren't fun (I won't use any nasty words in here)

Linked tables seems to be the easiest way to get the data all into one place from multiple systems (Oracle, Sybase, SQL Server). Some of my queries are quite fun! Nothing like derived tables from openQueries joining Sybase to Oracle to SQL Server!

Programming today is a race between software engineers striving to build better and bigger idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning. - Rick Cook
 
tell me about it. I have a couple with hundreds of ''''' just to get the parameter in. It was more trail and error. Add one, test, add one more, test, delete one in another place (please work), test, test again. Sometimes I wonder if it is worth all the trouble. Next time I will just write an application that does all that and uses better drivers.

Next time.

Christiaan Baes
Belgium

"My new site" - Me
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top