SQL View

Posted on 2011-04-27
Last Modified: 2012-05-11
Can I create a view in one database over tables in another database? If so, how?
Question by:qbjgqbjg
    LVL 6

    Accepted Solution

    You can pull information from other DB's on the same server by doing something like this.
    select * from [mydb].dbo.mytable
    LVL 142

    Expert Comment

    by:Guy Hengel [angelIII / a3]
    yes, that is perfectly possible.
    LVL 40

    Assisted Solution

    >> Can I create a view in one database over tables in another database? If so, how?
    like this.
    use Database1
    create view dbo.myView as 
    select * from Database2.dbo.Table1

    Open in new window


    Author Closing Comment

    Thanks very much.

    Write Comment

    Please enter a first name

    Please enter a last name

    We will never share this with anyone.

    Featured Post

    How to run any project with ease

    Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
    - Combine task lists, docs, spreadsheets, and chat in one
    - View and edit from mobile/offline
    - Cut down on emails

    Suggested Solutions

    Hi all, It is important and often overlooked to understand “Database properties”. Often we see questions about "log files" or "where is the database" and one of the easiest ways to get general information about your database is to use “Database p…
    How to leverage one TLS certificate to encrypt Microsoft SQL traffic and Remote Desktop Services, versus creating multiple tickets for the same server.
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
    Sending a Secure fax is easy with eFax Corporate ( First, Just open a new email message.  In the To field, type your recipient's fax number You can even send a secure international fax — just include t…

    779 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now