Tuesday, March 20, 2012

problem exporting views

While exporting a database with "export > objects > selecting the views"
I get the error:
Invalid object name 'dbo.myview'
The weird thing is that this view allready exists in the destination dbase.
Any help appreciated.
THX
"nicholas" <murmurait1@.hotmail.com> wrote in
news:Ol2emWkgFHA.1948@.TK2MSFTNGP12.phx.gbl:

> While exporting a database with "export > objects > selecting the
> views" I get the error:
> Invalid object name 'dbo.myview'
> The weird thing is that this view allready exists in the destination
> dbase.
> Any help appreciated.
> THX
>
>
Run the following query in your user database. What are the results?
select t1.name, t2.name
from sysobjects t1, sysusers t2
where t1.name = 'myview' and t1.uid = t2.uid
Regards
JTC ^..^
|||Sorry to ask, but how can I do this?
I tried the SQL query analyser and inserted:
select t1.name, t2.name
from sysobjects t1, sysusers t2
where t1.name = [mydatabase].[dbo].[tbl_customers] and t1.uid = t2.uid
but get this message:
Server: Msg 107, Level 16, State 2, Line 1
The column prefix 'mydatabase.dbo' does not match with a table name or alias
name used in the query
thx a lot
"JTC ^..^" <dave@.(nospam)JazzTheCat.co.uk> wrote in message
news:Xns968BC0C2DE4E1daveJTC@.213.123.26.234...
> "nicholas" <murmurait1@.hotmail.com> wrote in
> news:Ol2emWkgFHA.1948@.TK2MSFTNGP12.phx.gbl:
>
> Run the following query in your user database. What are the results?
> select t1.name, t2.name
> from sysobjects t1, sysusers t2
> where t1.name = 'myview' and t1.uid = t2.uid
> --
> Regards
> JTC ^..^
|||You are supposed to replace "mydatabase" with the name of your database. And "myview" with the name
of your view.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"nicholas" <murmurait1@.hotmail.com> wrote in message news:OcWsU$lgFHA.4000@.TK2MSFTNGP12.phx.gbl...
> Sorry to ask, but how can I do this?
> I tried the SQL query analyser and inserted:
> select t1.name, t2.name
> from sysobjects t1, sysusers t2
> where t1.name = [mydatabase].[dbo].[tbl_customers] and t1.uid = t2.uid
> but get this message:
> Server: Msg 107, Level 16, State 2, Line 1
> The column prefix 'mydatabase.dbo' does not match with a table name or alias
> name used in the query
> thx a lot
> "JTC ^..^" <dave@.(nospam)JazzTheCat.co.uk> wrote in message
> news:Xns968BC0C2DE4E1daveJTC@.213.123.26.234...
>
|||Yes, ofcourse, I did that.
"Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
message news:u%23d$xEmgFHA.2472@.TK2MSFTNGP15.phx.gbl...
> You are supposed to replace "mydatabase" with the name of your database.
And "myview" with the name
> of your view.
> --
> Tibor Karaszi, SQL Server MVP
> http://www.karaszi.com/sqlserver/default.asp
> http://www.solidqualitylearning.com/
> Blog: http://solidqualitylearning.com/blogs/tibor/
>
> "nicholas" <murmurait1@.hotmail.com> wrote in message
news:OcWsU$lgFHA.4000@.TK2MSFTNGP12.phx.gbl...[vbcol=seagreen]
alias
>
|||"nicholas" <murmurait1@.hotmail.com> wrote in
news:OQwceImgFHA.3256@.TK2MSFTNGP12.phx.gbl:

> Yes, ofcourse, I did that.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com>
> wrote in message news:u%23d$xEmgFHA.2472@.TK2MSFTNGP15.phx.gbl...
> And "myview" with the name
> news:OcWsU$lgFHA.4000@.TK2MSFTNGP12.phx.gbl...
> alias
>
Like this...
select t1.name, t2.name
from sysobjects t1, sysusers t2
where t1.name = 'tbl_customers' and t1.uid = t2.uid
The idea is that the query will returns all tables named tbl_customers
along with the table owners. Please Copy and Paste the results.
Regards
JTC ^..^
|||Go back to the proposed query, and fix below things:
Do not remove the quotes around the name of the view in the WHERE clause. Do not fully qualify the
object name in the where clause.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://www.solidqualitylearning.com/
Blog: http://solidqualitylearning.com/blogs/tibor/
"nicholas" <murmurait1@.hotmail.com> wrote in message news:OQwceImgFHA.3256@.TK2MSFTNGP12.phx.gbl...
> Yes, ofcourse, I did that.
>
> "Tibor Karaszi" <tibor_please.no.email_karaszi@.hotmail.nomail.com> wrote in
> message news:u%23d$xEmgFHA.2472@.TK2MSFTNGP15.phx.gbl...
> And "myview" with the name
> news:OcWsU$lgFHA.4000@.TK2MSFTNGP12.phx.gbl...
> alias
>

No comments:

Post a Comment