Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

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

Posted on 2006-06-15
1
Medium Priority
?
264 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
1 Comment
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 1500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A Stored Procedure in Microsoft SQL Server is a powerful feature that it can be used to execute the Data Manipulation Language (DML) or Data Definition Language (DDL). Depending on business requirements, a single Stored Procedure can return differe…
MSSQL DB-maintenance also needs implementation of multiple activities. However, unprecedented errors can hamper the database management. In that case, deploying Stellar SQL Database Toolkit ensures fast and accurate database and backup repair as wel…
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 set up a backup for SQL Server using a Maintenance Plan and how to schedule the job into SQL Server Agent.
Suggested Courses

810 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