Question

When I select all data from table/view person from database city I'll do it like this:

select * from city..person

ASE then substitutes the * to all the columns and .. for .dbo. and the query will be this:

select name, age, sex from city.dbo.person

If I have another view person created by another user (lets call it boss), and I want to access that view I need to make a select like this:

select * from city.boss.person

Is there a way to make the city..person to be city.boss.person instead of city.dbo.person?

Was it helpful?

Solution

The naming convention in Sybase to identify a table/view is [[database.]owner.]table_or_view_name, which means that the database and owner qualifiers are optional.

If you don't specify them, database is expanded to the current database and owner is expanded to the current user.

In your example, city..person expanded to city.dbo.person, because you're running under dbo user. The only way to have ASE expanding city..person to city.boss.person, is running the query under the boss user.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top