Re: Joining tables from two databases



There are two different web accounts. In this case I can't have the same web
account with rights to both tables. Would there be some way to perhaps read
data from both tables into the application as DataTables and then do the
select command against the results? Or some other way to use both web
accounts?

Thanks for the help


"William (Bill) Vaughn" wrote:

If both databases are on the same server (and the web account has rights to
both) you can simply reference the database table using the syntax:

databasename.tablename.owner.column

hth

--
____________________________________
William (Bill) Vaughn
Author, Mentor, Consultant
Microsoft MVP
INETA Speaker
www.betav.com/blog/billva
www.betav.com
Please reply only to the newsgroup so that others can benefit.
This posting is provided "AS IS" with no warranties, and confers no rights.
__________________________________
Visit www.hitchhikerguides.net to get more information on my latest book:
Hitchhiker's Guide to Visual Studio and SQL Server (7th Edition)
and Hitchhiker's Guide to SQL Server 2005 Compact Edition (EBook)
-----------------------------------------------------------------------------------------------------------------------

"T McDonald" <TMcDonald@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:92A0B035-8D36-4302-9353-C88AF5C5DB0D@xxxxxxxxxxxxxxxx
Both are SQL Server databases on the same server. This is an asp.net
application, each database has it's own accounts.

I'm not really following how you are solving it using a service account.

As I understand, to create a connection I need to use a connection string
that indicates the db and credentials I'm using. If I have more than one
db,
how would I connect to both in order to run a select statement over both
databases.

"Sundar Narasiman" wrote:

T McDonald,

I would like to know the following
1. Are these 2 databases are SQL Server ?
2. Are these 2 databases living in the same instance of SQL Server ?

You should not connect to these two databases using Web User Name and
Password. This is not the recommended approach.

Your data-access code (assembly) should be living in the
middle tier of the Server Farm. You should setup a SERVICE ACCOUNT to
access
the data from these 2 databases. The SERVICE ACCOUNT should have enough
privileges on those 2 databases.

--
Thanks & Regards,
Sundar Narasiman


"T McDonald" wrote:

I am having trouble figuring out how I might do the following, if I can
do it
at all. I have two databases, each with their own separate
authentication
details.

I have a select statement that gets the data from one table based on
existence in another table in another database. This works fine when
using
the windows authentication. What I don't understand how to do, is to
connect
to both databases in a web project where it is using the webuser name
and
password. Could someone steer me in the right direction on doing this.

I hope my explanation is somewhat clear.

Thanks



.



Relevant Pages

  • Re: Help with Software/Hardware decision....
    ... SQL server on DC question has two aspects such as performance and security. ... the computer running SQL Server as a domain controller will work (and it ... MSSQLServer service must run within the security context of an NT account. ... This configuration lets users assign permissions and rights to a service by ...
    (microsoft.public.windows.server.networking)
  • Re: Scheduling a simple local package wont stick
    ... the FTP is just the first part of this package I wish to accomplish. ... group does not need to be, and on my servers is not, a SQL Server sysadmin. ... it is not obvious to me which account you are running under ... The rights you need to check are not SQL Server rights, ...
    (microsoft.public.sqlserver.dts)
  • Re: ASP.NET - SQL Server does not exist or access denied
    ... Make sure that the account is set up with "Log on as a Service" and "Log on as ... Make sure you've looked at your machine.config file as well (Windows ... ensure it would have no rights as a user), then set it up with the "log on" ... > a "SQL Server does not exist or access denied" error. ...
    (microsoft.public.sqlserver.security)
  • Re: Databases connections not working more with all web sites
    ... First check for permission problems. ... account for one of the sites with a problem to an account with administrator ... > Databases connections, both, for MS SQL Server 2000 and MS Access ...
    (microsoft.public.inetserver.asp.db)
  • Re: Placement of database (newbie question)
    ... What account rights is the SQL Server service running with? ...
    (microsoft.public.sqlserver.server)