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

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
Paul_BlacklerAsked:
Who is Participating?

[Webinar] Streamline your web hosting managementRegister Today

x
 
Guy Hengel [angelIII / a3]Connect With a Mentor Billing EngineerCommented:
you cannot create a view in another database. you have to issue a  USE <databaseB> in between (with GO statement in between)
0
All Courses

From novice to tech pro — start learning today.