Distributed query

Distributed query

Post by Nata Krivono » Wed, 28 Mar 2001 21:49:35



Hi, all!

Here is my question: I need get data from remote sql server. For example,
there are sql servers SQL1 an SQL2 with databases db1 and db2 accordingly. I
want get data from sql.db1 during connection to sql2.db2

Actions from SQL server book:

on sql1 execute: exec sp_serveroption 'sql1', 'data access', 'true'

Then on sql2 I may write: select * from sql1.db1.dbo.table1 or select * from
openquery(sql1, 'select * from sql1.db1.dbo.table1')

But I get error: Server 'sql1' is not configured for DATA ACCESS.

What else I need to do ?

Thanks.
Nata.

 
 
 

Distributed query

Post by Germa » Wed, 28 Mar 2001 22:04:34


Try through remote server or add it in linked servers group.
Or use openrowset. There inherit new high level odbc connection but syntax
small.
In last edvise use somesing like this:
select * from openrowset('MSDASQL', 'DSN=NAME', 'select * from Table')


Quote:> Hi, all!

> Here is my question: I need get data from remote sql server. For example,
> there are sql servers SQL1 an SQL2 with databases db1 and db2 accordingly.
I
> want get data from sql.db1 during connection to sql2.db2

> Actions from SQL server book:

> on sql1 execute: exec sp_serveroption 'sql1', 'data access', 'true'

> Then on sql2 I may write: select * from sql1.db1.dbo.table1 or select *
from
> openquery(sql1, 'select * from sql1.db1.dbo.table1')

> But I get error: Server 'sql1' is not configured for DATA ACCESS.

> What else I need to do ?

> Thanks.
> Nata.


 
 
 

Distributed query

Post by Nata Krivono » Wed, 28 Mar 2001 22:29:20


Server is already added to linked servers group. Using openrowset lead me to
same error.


> Try through remote server or add it in linked servers group.
> Or use openrowset. There inherit new high level odbc connection but syntax
> small.
> In last edvise use somesing like this:
> select * from openrowset('MSDASQL', 'DSN=NAME', 'select * from Table')



> > Hi, all!

> > Here is my question: I need get data from remote sql server. For
example,
> > there are sql servers SQL1 an SQL2 with databases db1 and db2
accordingly.
> I
> > want get data from sql.db1 during connection to sql2.db2

> > Actions from SQL server book:

> > on sql1 execute: exec sp_serveroption 'sql1', 'data access', 'true'

> > Then on sql2 I may write: select * from sql1.db1.dbo.table1 or select *
> from
> > openquery(sql1, 'select * from sql1.db1.dbo.table1')

> > But I get error: Server 'sql1' is not configured for DATA ACCESS.

> > What else I need to do ?

> > Thanks.
> > Nata.

 
 
 

Distributed query

Post by Germa » Wed, 28 Mar 2001 22:39:58


For openrowset you must use odbc connection. Are you sure you do it correct?
In even of using Linked server you must point there destination in 5
elements: Server_name.Database_Name.Owner_Name.Table_Name.


> Server is already added to linked servers group. Using openrowset lead me
to
> same error.




> > Try through remote server or add it in linked servers group.
> > Or use openrowset. There inherit new high level odbc connection but
syntax
> > small.
> > In last edvise use somesing like this:
> > select * from openrowset('MSDASQL', 'DSN=NAME', 'select * from Table')



> > > Hi, all!

> > > Here is my question: I need get data from remote sql server. For
> example,
> > > there are sql servers SQL1 an SQL2 with databases db1 and db2
> accordingly.
> > I
> > > want get data from sql.db1 during connection to sql2.db2

> > > Actions from SQL server book:

> > > on sql1 execute: exec sp_serveroption 'sql1', 'data access', 'true'

> > > Then on sql2 I may write: select * from sql1.db1.dbo.table1 or select
*
> > from
> > > openquery(sql1, 'select * from sql1.db1.dbo.table1')

> > > But I get error: Server 'sql1' is not configured for DATA ACCESS.

> > > What else I need to do ?

> > > Thanks.
> > > Nata.

 
 
 

Distributed query

Post by Nata Krivono » Wed, 28 Mar 2001 23:10:13


I don't want use odbc and I want to manage with T-SQL. It seems strange:
before some time my example was workable. Since then I configure my servers
for remote access with commands
exec sp_configure 'remote access', 1
RECONFIGURE
May it changes break data access tuning ?

Thank you, German, for you help ;-))


> For openrowset you must use odbc connection. Are you sure you do it
correct?
> In even of using Linked server you must point there destination in 5
> elements: Server_name.Database_Name.Owner_Name.Table_Name.



> > Server is already added to linked servers group. Using openrowset lead
me
> to
> > same error.



> > > Try through remote server or add it in linked servers group.
> > > Or use openrowset. There inherit new high level odbc connection but
> syntax
> > > small.
> > > In last edvise use somesing like this:
> > > select * from openrowset('MSDASQL', 'DSN=NAME', 'select * from Table')



> > > > Hi, all!

> > > > Here is my question: I need get data from remote sql server. For
> > example,
> > > > there are sql servers SQL1 an SQL2 with databases db1 and db2
> > accordingly.
> > > I
> > > > want get data from sql.db1 during connection to sql2.db2

> > > > Actions from SQL server book:

> > > > on sql1 execute: exec sp_serveroption 'sql1', 'data access', 'true'

> > > > Then on sql2 I may write: select * from sql1.db1.dbo.table1 or
select
> *
> > > from
> > > > openquery(sql1, 'select * from sql1.db1.dbo.table1')

> > > > But I get error: Server 'sql1' is not configured for DATA ACCESS.

> > > > What else I need to do ?

> > > > Thanks.
> > > > Nata.

 
 
 

Distributed query

Post by Germa » Wed, 28 Mar 2001 23:26:41


But by default 'remote access' = 1


> I don't want use odbc and I want to manage with T-SQL. It seems strange:
> before some time my example was workable. Since then I configure my
servers
> for remote access with commands
> exec sp_configure 'remote access', 1
> RECONFIGURE
> May it changes break data access tuning ?

> Thank you, German, for you help ;-))


> > For openrowset you must use odbc connection. Are you sure you do it
> correct?
> > In even of using Linked server you must point there destination in 5
> > elements: Server_name.Database_Name.Owner_Name.Table_Name.



> > > Server is already added to linked servers group. Using openrowset lead
> me
> > to
> > > same error.



> > > > Try through remote server or add it in linked servers group.
> > > > Or use openrowset. There inherit new high level odbc connection but
> > syntax
> > > > small.
> > > > In last edvise use somesing like this:
> > > > select * from openrowset('MSDASQL', 'DSN=NAME', 'select * from
Table')



> > > > > Hi, all!

> > > > > Here is my question: I need get data from remote sql server. For
> > > example,
> > > > > there are sql servers SQL1 an SQL2 with databases db1 and db2
> > > accordingly.
> > > > I
> > > > > want get data from sql.db1 during connection to sql2.db2

> > > > > Actions from SQL server book:

> > > > > on sql1 execute: exec sp_serveroption 'sql1', 'data access',
'true'

> > > > > Then on sql2 I may write: select * from sql1.db1.dbo.table1 or
> select
> > *
> > > > from
> > > > > openquery(sql1, 'select * from sql1.db1.dbo.table1')

> > > > > But I get error: Server 'sql1' is not configured for DATA ACCESS.

> > > > > What else I need to do ?

> > > > > Thanks.
> > > > > Nata.

 
 
 

1. distributed query,distributed transaction,sp_getapplock

Hi,

  I'm trying to use sp_getapplock inside a stored procedure (MSSQL
2000) which makes use of a distributed transaction.  In order to
execute this distributed transaction though I have to use
sp_executesql, do to the fact that I need to build a variable into the
"where" clause of the query. This works in the procedure when I'm not
using sp_getapplock, but suddenly gives me an error when I do use it:

Server: Msg 7391, Level 16, State 1, Line 1
The operation could not be performed because the OLE DB provider
'MSDASQL' was unable to begin a distributed transaction.
[OLE/DB provider returned message: [Microsoft][ODBC driver for
Oracle]Driver not capable]

I can't think of a way to do this without using sp_executesql because
if the the date filter in the "where" clause is performed on my side
and not the client it will first pull the entire table over (which can
get up to around 25,000,000 rows!) before filtering out the dates I
want.

Are there any settings I need to fix in SQL server to allow such an
operation to be performed with sp_executesql,sp_getapplock and
distributed transactions?  Or is there some other way for me to lock
this transaction without conflicting with sp_executesql?  Any help
would be greatly appreciated!! I'll paste the relevant parts of my
procedure below in case it helps (the whole thing is too long)

Thanks!


'msf170_update_lock','Exclusive','Transaction',0


begin
        rollback transaction
end



MIMS.MSF170


                        select *

char(39) + ')'


2. MS-SQL Server Problems

3. Distributed query using ADSI to query NT PDC

4. Dynamic Server & Netscape Server

5. Distributed Queries

6. bug or limit?

7. Optimising Distributed Queries: Thoughts and Resources

8. Oracle / other RDBMS project all-rounder needed - UK and EU applicants

9. SQL Server 2000 Distributed queries bug

10. A distributed query error on a bookmark !

11. problem with distributed query on linked server (msidxs)

12. Need Help with SQL 7 Distributed Queries

13. Distributed Query And ANSI_NULLS