Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 error creating view

Author  Topic 

jlbantang
Starting Member

16 Posts

Posted - 2007-07-25 : 05:01:30
i tried running the statement :

(1)
create view qcostcentre
as
select * from dbo.costcentre.dtblcostcentre

>ERR: Msg 208, Level 16, State 1, Procedure qcostcentre, Line 4
Invalid object name 'dbo.costcentre.dtblcostcentre'.

(2)
create view qcostcentre
as
select * from costcentre.pcusers.dbo.dtblcostcentre

>ERR: Msg 7202, Level 11, State 2, Procedure qcostcentre, Line 4
Could not find server 'costcentre' in sys.servers. Verify that the correct server name was specified. If necessary, execute the stored procedure sp_addlinkedserver to add the server to sys.servers.


note: pcusers is a user of 2 database (costcentre & datamaster) with dbo_datareader owned & role schema .

shallu1_gupta
Constraint Violating Yak Guru

394 Posts

Posted - 2007-07-25 : 05:04:52
Modify it as

create view qcostcentre
as
select * from costcentre.dbo.dtblcostcentre
Go to Top of Page

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2007-07-25 : 05:06:42
where are you creating the view ? Why do you need to prefix with the table name ?

create view qcostcentre
as
select * from dbo.dtblcostcentre



KH
[spoiler]Time is always against us[/spoiler]

Go to Top of Page

jlbantang
Starting Member

16 Posts

Posted - 2007-07-25 : 05:16:13
khtan: im playing with view cmd, that is.

shall: thnx its working but you there is typo in your sample dtblcostcentre instead of tblcostcentre
anyway i figure it out. lol

TNX
Go to Top of Page
   

- Advertisement -