SQL View

Can I create a view in one database over tables in another database? If so, how?
qbjgqbjgConsultantAsked:
Who is Participating?
 
cfEngineersConnect With a Mentor Commented:
You can pull information from other DB's on the same server by doing something like this.
select * from [mydb].dbo.mytable
0
 
Guy Hengel [angelIII / a3]Billing EngineerCommented:
yes, that is perfectly possible.
0
 
SharathConnect With a Mentor Data EngineerCommented:
>> Can I create a view in one database over tables in another database? If so, how?
like this.
use Database1
go
create view dbo.myView as 
select * from Database2.dbo.Table1
go

Open in new window

0
 
qbjgqbjgConsultantAuthor Commented:
Thanks very much.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.