x
login about faq Site discussion (meta-askssc)

SQL openquery puzzle

Select * From OpenQuery (Ftw003, 'Select * From Mold');

Returns one row from a table that has 12837 records

more ▼

asked Jan 02 '10 at 06:29 AM in Default

Don 1 gravatar image

Don 1
41 1 1 1

(comments are locked)
10|1200 characters needed characters left

2 answers: sort voted first

Something like this should hopefully do the trick?

SELECT *
FROM OPENROWSET(
    'SQLNCLI', 
    'Server=Ftw003;Trusted_Connection=yes;',
    'SELECT * FROM Mold'
);
more ▼

answered Feb 13 '10 at 03:05 PM

Ian Roke gravatar image

Ian Roke
1.7k 24 29 31

(comments are locked)
10|1200 characters needed characters left

Try using OPENROWSET instead. It could be something around the fact that OQ only returns one resultset, which could perhaps be getting confused depending on what your linked server is.

more ▼

answered Jan 02 '10 at 10:46 AM

Rob Farley gravatar image

Rob Farley
5.7k 13 17 19

(comments are locked)
10|1200 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments



Facebook logo Follow Ask SSC on Facebook
Find Ask SSC on Google+
linkedin logo Find us on LinkedIn

Topics:

x92
x26

asked: Jan 02 '10 at 06:29 AM

Seen: 1409 times

Last Updated: Jan 02 '10 at 10:47 AM

Copyright © 2002-2012 Simple Talk Publishing. All Rights Reserved. If you have any queries, please contact the site administrators.
Ask SQL Server Central is a community service provided by Red Gate.