Forgot to say, you can then access the view as if it were a table within the main 
database:

SELECT  * 
FROM    dbo.vwUser

-----Original Message-----
From: Chris Thomas 
Sent: 14 January 2004 09:26
To: [EMAIL PROTECTED]
Subject: RE: [ cf-dev ] Connecting to tables in different SQL Server
databases.


You could try creating a view into the other databases, e.g:

CREATE VIEW dbo.vwUser
AS
SELECT     *
FROM         registration.dbo.[User]
 
(Where registration is the database name )
 
Or you can just reference the other databases remotety, e.g.:
 
SELECT     *
FROM         registration.dbo.[User]
 
I think the first option is better, as then the code or stored proc isn't dependant on 
a database name.
 
Hope this helps,
Chris.
 
 -----Original Message-----
From: Osullivan Karl (RKB) Senior Analyst/Programmer [mailto:[EMAIL PROTECTED]
Sent: 14 January 2004 08:50
To: CF - Development Group
Subject: [ cf-dev ] Connecting to tables in different SQL Server databases.



UHCWT Logo




Hi All

I need to do a query that links tables across SQL Server databases that are on the 
same server.

I'm unsure how to do this in CF, as when I set up a datasource it points to one 
database only.  Does anyone have any ideas how to do it please?

Thanks


Karl O'Sullivan
Senior Analyst/Programmer

Computer & Network Services
UHCW NHS Trust
Clifford Bridge Road
COVENTRY
CV2 2DX

Contact:
Tel (internal): 28952
Tel (external): +44 (0) 24 7696 8952
Email: [EMAIL PROTECTED]
Web: www.uhcw.nhs.uk 

 

 


--
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to