|
Hi, I've a SQL Express 2008 32-bit database running on a WIndows Server 2008 R2 64-bit virtual machine. I've got a linked server to a Progress V9.10E database, and I'd like to set up a db view on the SQL server. I've already done this on one of the smaller Progress tables and it works OK. However, when I try to query a large table, the query just runs and runs and doesn't return the data like it should. I'm trying to use Openquery to improve things, but I have problems with the quotation marks, I think. Here's my stored procedure code: I broke the query statement into bits trying to overcome problems, but no luck. The query runs absolutely fine on the Progress DB itself, but here is the SQL output: Any help will be welcome! Thanks, Steve
(comments are locked)
|
|
The problem here is the string concatenation. You are missing quote marks around GC and D. Take a look at the query that results from the command Now, as you are wanting this to be one long text, you need to double-up the quote marks for GC and D, so that when they are added to this long string, they get the quote-marks that they require. This is done by changing the code to set @SQL2 to the following: Here you use the function Hi William, Thanks for your help. That is great, it works. I did have to change something else, I didn't realise that until I used your code. I was using the four part name INDEXREADONLY..PUB.Entryheader but didn't need to since the linked server name is in the Openquery code. I was unaware of the QUOTENAME function, so thanks again! Steve
Oct 01 '10 at 02:12 AM
steveblakemore
(comments are locked)
|

