Click here to monitor SSC
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Openrowset issue


Openrowset issue

Author
Message
sqlbi.vvamsi
sqlbi.vvamsi
Valued Member
Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)Valued Member (54 reputation)

Group: General Forum Members
Points: 54 Visits: 412
Hello,

I'm trying to fetch table data from Server B to a temp table in Server A. I didn't get entire data when I ran query below.

select * into temptbl from openrowset('SQLOLEDB','Data Source=Server B; Initial Catalog=DB;trusted_connection=yes;','select * from dbo.SrcTable')

To figure out where it is going wrong, I did count query to see how many rows it is fetching
when I run the below query from my local machine(client) I get less number of rows(count). when I run the same query directly on src machine it gives me exact count. Can someone tell me why and where am I losing data.

select count(*) from openrowset('SQLOLEDB','Data Source=Server B; Initial Catalog=DB;trusted_connection=yes;','select count(*) from dbo.SrcTable')

Note: I cannot use linked server.
Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum

































































































































































SQLServerCentral


Search