SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 


Updating base tables through views in 2 separate DBs through DB Chaining.


Updating base tables through views in 2 separate DBs through DB Chaining.

Author
Message
Feivel
Feivel
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5302 Visits: 1897
All,

I am on the look out for some suggestions on how to get it working. Let me explain you what our config looks like, so we have 2 databases one which has some base tables in dbo schema let's say db A and have like x no. of tables that are used by 3 views in another db let's say B and these 3 views are in a different schema have underlying triggers that would be used to perform DML operations on these base tables. Now, the requirement is to have a specific login for e.g domain\xyz-advanced which would have access to the db B on these views to perform DML operations but it won't have any access as such to view or do anything in db A. Just fyi...I've enabled DB chaining on both the DBs and mapped the login account as a public user on db A as a criteria for DB Chaining. However, when I am trying to use the login in order to select through the views it throws me an error as below.

The server prinicpal domain\xyz-advanced is not able to access the database A under the current security context.

I've pretty much looked into the DB properties or anywhere that would cause an explicit revoke or deny but didn't find anything out of ordinary...so I am not sure why it isn't working.
Alexander Zhang
Alexander Zhang
SSC Eights!
SSC Eights! (941 reputation)SSC Eights! (941 reputation)SSC Eights! (941 reputation)SSC Eights! (941 reputation)SSC Eights! (941 reputation)SSC Eights! (941 reputation)SSC Eights! (941 reputation)SSC Eights! (941 reputation)

Group: General Forum Members
Points: 941 Visits: 261
ffarouqi - Wednesday, March 7, 2018 11:30 AM
All,

I am on the look out for some suggestions on how to get it working. Let me explain you what our config looks like, so we have 2 databases one which has some base tables in dbo schema let's say db A and have like x no. of tables that are used by 3 views in another db let's say B and these 3 views are in a different schema have underlying triggers that would be used to perform DML operations on these base tables. Now, the requirement is to have a specific login for e.g domain\xyz-advanced which would have access to the db B on these views to perform DML operations but it won't have any access as such to view or do anything in db A. Just fyi...I've enabled DB chaining on both the DBs and mapped the login account as a public user on db A as a criteria for DB Chaining. However, when I am trying to use the login in order to select through the views it throws me an error as below.

The server prinicpal domain\xyz-advanced is not able to access the database A under the current security context.

I've pretty much looked into the DB properties or anywhere that would cause an explicit revoke or deny but didn't find anything out of ordinary...so I am not sure why it isn't working.

First of all, make sure the DBs are owned by the same login, such as sa.


GASQL.com - Focus on Database and Cloud
Feivel
Feivel
SSCertifiable
SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)SSCertifiable (5.3K reputation)

Group: General Forum Members
Points: 5302 Visits: 1897
Alexander Zhang - Thursday, March 8, 2018 11:00 AM
ffarouqi - Wednesday, March 7, 2018 11:30 AM
All,

I am on the look out for some suggestions on how to get it working. Let me explain you what our config looks like, so we have 2 databases one which has some base tables in dbo schema let's say db A and have like x no. of tables that are used by 3 views in another db let's say B and these 3 views are in a different schema have underlying triggers that would be used to perform DML operations on these base tables. Now, the requirement is to have a specific login for e.g domain\xyz-advanced which would have access to the db B on these views to perform DML operations but it won't have any access as such to view or do anything in db A. Just fyi...I've enabled DB chaining on both the DBs and mapped the login account as a public user on db A as a criteria for DB Chaining. However, when I am trying to use the login in order to select through the views it throws me an error as below.

The server prinicpal domain\xyz-advanced is not able to access the database A under the current security context.

I've pretty much looked into the DB properties or anywhere that would cause an explicit revoke or deny but didn't find anything out of ordinary...so I am not sure why it isn't working.

First of all, make sure the DBs are owned by the same login, such as sa.

Yes it is.

Go


Permissions

You can't post new topics.
You can't post topic replies.
You can't post new polls.
You can't post replies to polls.
You can't edit your own topics.
You can't delete your own topics.
You can't edit other topics.
You can't delete other topics.
You can't edit your own posts.
You can't edit other posts.
You can't delete your own posts.
You can't delete other posts.
You can't post events.
You can't edit your own events.
You can't edit other events.
You can't delete your own events.
You can't delete other events.
You can't send private messages.
You can't send emails.
You can read topics.
You can't vote in polls.
You can't upload attachments.
You can download attachments.
You can't post HTML code.
You can't edit HTML code.
You can't post IFCode.
You can't post JavaScript.
You can post emoticons.
You can't post or upload images.

Select a forum








































































































































































SQLServerCentral


Search