Solved

Working on one database and creating and storing a view on another database

Posted on 2006-06-15
1
258 Views
Last Modified: 2006-11-18
Hi - All
I need to whilst working on one database (sql Query Analyser), create a view in another database and store it in the other database. I am thinking that this will be a distributed query - advice please.
Was trying to run something like
Use <Database A>
code
code
CREATE VIEW <Database B>.dbo.Test_View AS select * from <Database B>.dbo.<table>

Thanks
0
Comment
Question by:Paul_Blackler
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
1 Comment
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 16910313
you cannot create a view in another database. you have to issue a  USE <databaseB> in between (with GO statement in between)
0

Featured Post

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I have a large data set and a SSIS package. How can I load this file in multi threading?
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example combined with referencing Books Online, show some of the information that can be extracted from the Catalog Views in SQL Server.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

728 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