Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

A Question about Views

Status
Not open for further replies.

levinll

Programmer
Oct 29, 2001
65
0
0
US
Is it possible to create a view in one database that uses a table from a different database ? If so, how ?
 
I have never heard of this being done, but that doesn't mean it can't be done. I don't know, my initial reaction is to say no, but I have been wrong before.

You might want to pose this question in a database forum for a more definative answer. You can try the VB database forum that is part of tek-tips or there is a link to the microsoft SQL server forum in the related forums section of this page. Thanks and Good Luck!

zemp
 
I'll do that. I'm trying to share a table (an employee information table) that will be common to many database application. It seems silly to have copies of the same table in each database that needs it.
 
If you are using Access, just link the table(s) to the database that you are creating the view.
 
I'm using SQL Server as a back end, and VB as a front end.
 
Yes it is popssible see an example below:-

NB/
Mortgages Table is in SQL Database Called Mortgages
Companies Table is in SQL Database Called Misc
View Created in Mortgages Database

Code:
CREATE VIEW dbo.[VW_Mortgages]
AS

/* Add Company Name to View - Standardised Display Name for Company*/
SELECT MISC..[Companies].CompanyTitle, Mortgages.Rate

....


/* Table Join:*/
FROM [Mortgages] INNER JOIN MISC..[Companies] ON Mortgages.COMPNO = MISC..[Companies].AKACODE



Regards,

Codefish


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top