all groups > sql server odbc > march 2005 >
You're in the

sql server odbc

group:

OPENROWSET returns only one row



OPENROWSET returns only one row RogerC
3/22/2005 10:24:34 PM
sql server odbc: Hi,
I am trying to access data from a Sage Line 100 database to populate tables
in SQL 2000.

If I use the following syntax in Query Analyser I only get the first row of
a table returned:

select * FROM OPENROWSET
('MSDASQL','DSN=SageLine132',UID=admin;PWD=;','select * FROM
STO_DEPOT_NAMES')

If I change the query string to 'select COUNT (*) FROM STO_DEPOT_NAMES' ,
the correct count of rows in the table is returned.

Using a DTS package to read from the Sage server and to populate the table
works fine.

Any ideas please?

Rogerc

Re: OPENROWSET returns only one row Madhivanan
3/24/2005 2:17:56 AM

Try this

Set Rowcount 0

select * FROM OPENROWSET
('MSDASQL','DSN=3DSageLine132',U=ADID=3Dadmin;PWD=3D;','select * FROM
STO_DEPOT_NAMES')=20

Madhivanan
AddThis Social Bookmark Button