I have a vendor database from I want to extract and transform certain information. As I dont want to change the structure of the original database due to licensing I therefor wondering if I can put together views from the vendor database but storing those in a second sql server 2008 database together with some other replicated and transformed data. The second database is supposed to live beside the first one on the same server.

Is it possible to have views like this and if so, do I loose a lot of performance when querying the views?

2 Answers 2


Licensing shouldn't stop you adding views to your first database. Every place I've been in has custom objects for reporting etc that extend the functionality of the 3rd party product.

Saying that, it is possible to have 3 part object names in views in your own database

SELECT ... FROM TheirDB.dbo.TheirTable

Yes it possible, that's what three part naming is for.

Use the form: [DatabaseName].[DatabaseOwner].[TableName] when referencing your vendor tables. ie:

CREATE View [ViewName]
SELECT * FROM [VendorDB].[dbo].[TableName]

Regarding performance, there's no big performance impacts, if the table has appropriate index and statistics these will be used by your queries in your DB.

Note: If you specify an index hint in your query, these will be ignored unless you bypass the view and refer to the table directly.

Location of your DB
As Stan noted, the above assumes that the two databases are residing on the same SQL Server instance, if you want to have a view residing in a different SQL instance (and I do not recommend this), you can:

  1. Setup a linked server to the Vendor DB
  2. Use four part naming in your view definition: [LinkedServerName].[DatabaseName].[DatabaseOwner].[TableName]


CREATE View [ViewName]  
SELECT * FROM [VendorDBInstance].[VendorDB].[dbo].[TableName]
  • The second DB also has to be on the same instance of SQL on the server. Jun 8, 2011 at 13:21
  • We do this all the time and works like a champ. Jun 8, 2011 at 14:00
  • does the user need to have permissions set on both databases?
    – bradvido
    Jan 19, 2016 at 20:27
  • This depends on the ownership chain (see: msdn.microsoft.com/en-us/library/ms188676.aspx), it is safest to grant connect permission to the both databases, and select permission against your view Jan 20, 2016 at 14:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.