Solved

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

Posted on 2006-06-15
1
224 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 142

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

Optimizing Cloud Backup for Low Bandwidth

With cloud storage prices going down a growing number of SMBs start to use it for backup storage. Unfortunately, business data volume rarely fits the average Internet speed. This article provides an overview of main Internet speed challenges and reveals backup best practices.

Question has a verified solution.

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

Slowly Changing Dimension Transformation component in data task flow is very useful for us to manage and control how data changes in SSIS.
Ever wondered why sometimes your SQL Server is slow or unresponsive with connections spiking up but by the time you go in, all is well? The following article will show you how to install and configure a SQL job that will send you email alerts includ…
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Viewers will learn how to use the SELECT statement in SQL to return specific rows and columns, with various degrees of sorting and limits in place.

919 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

14 Experts available now in Live!

Get 1:1 Help Now