December 6, 2016 at 6:24 am
We have an app user with default schema 'bill' . The scripts given by developers never mention the schema name 'bill' before object name as its default for them . My question is will this cause performance issue?
December 6, 2016 at 6:34 am
yes it could potentially cause problems. best practice would be to go ahead and schema-qualify all the scripts provided to avoid any issues.
The scenario i would worry about is if the app user gets access to the dbo schema, even though it's default schema is [bill], you could start getting object not found errors, because the table [invoices] is actually [bill].[invoices] but a query resolves to [dbo].[invoices], which doesn't exist.
Redgate's SQL Prompt has some nice features to schema-qualify and square bracket qualify scripts like that, so you can fix scripts really quickly.
Lowell
December 7, 2016 at 4:23 am
Lowell (12/6/2016)
yes it could potentially cause problems. best practice would be to go ahead and schema-qualify all the scripts provided to avoid any issues.The scenario i would worry about is if the app user gets access to the dbo schema, even though it's default schema is [bill], you could start getting object not found errors, because the table [invoices] is actually [bill].[invoices] but a query resolves to [dbo].[invoices], which doesn't exist.
Redgate's SQL Prompt has some nice features to schema-qualify and square bracket qualify scripts like that, so you can fix scripts really quickly.
Thanks Lowell,
User have datareader and datawriter permission on DB and default schema is [bill]. As per my understanding for this user it will check the [bill] schema first and then dbo and it wont go any further. Please correct if I am wrong.
December 7, 2016 at 4:46 am
Rechana Rajan (12/7/2016)
As per my understanding for this user it will check the [bill] schema first and then dbo and it wont go any further. Please correct if I am wrong.
No, it will check the default Schema only. If that default is [bill] then it will check for [bill].[tablename]. If [bill].[tablename] does not exist, then the failure occurs.
Thom~
Excuse my typos and sometimes awful grammar. My fingers work faster than my brain does.
Larnu.uk
May 1, 2017 at 8:08 am
Thom A - Wednesday, December 7, 2016 4:46 AMRechana Rajan (12/7/2016)
As per my understanding for this user it will check the [bill] schema first and then dbo and it wont go any further. Please correct if I am wrong.No, it will check the default Schema only. If that default is [bill] then it will check for [bill].[tablename]. If [bill].[tablename] does not exist, then the failure occurs.
Thanks Thom
Viewing 5 posts - 1 through 4 (of 4 total)
You must be logged in to reply to this topic. Login to reply