Home All Groups Group Topic Archive Search About

Connection string for 1 server and 2 databases

Author
2 Dec 2005 2:02 PM
Bill nguyen
Is there a way to access 2 databases simultaneously using a single
connection string?
server: SQLSERVER
databases:
gasstations
customers

I'm working on a VB.NET application.

Thanks

Bill

Author
2 Dec 2005 2:20 PM
Aaron Bertrand [SQL Server MVP]
No, in your query, qualify the database you are not connected to (or to be
safe, qualify databases everywhere).  E.g.

SELECT col_list
    FROM database1.dbo.tableA
    INNER JOIN database2.dbo.tableB
    ...



Show quote
"Bill nguyen" <billn_nospam_please@jaco.com> wrote in message
news:ezdCZk09FHA.1032@TK2MSFTNGP11.phx.gbl...
> Is there a way to access 2 databases simultaneously using a single
> connection string?
> server: SQLSERVER
> databases:
> gasstations
> customers
>
> I'm working on a VB.NET application.
>
> Thanks
>
> Bill
>
>

AddThis Social Bookmark Button