Showing posts with label applications. Show all posts
Showing posts with label applications. Show all posts

Sunday, March 11, 2012

Database Role that allows execution of stored procedures?

We have a rule for developing database-driven applications that all
interaction with the database must be done through stored procedures i.e.
all selects, inserts, updates etc.
I am looking for simple ways to enforce & support this design principle -
and one would be if I could put the SQL login that the application uses into
a database role(s) that only allowed execution of stored procedure, i.e. no
direct access to tables or views. I know that the long way to do this is to
create my own role and grant it execute rights on each SP and no rights to
tables/views, but I was wondering if there was anything already built into
SQL Server.
No built-in role like that in SQL Server 2000. You'll have to create your
own database role, and give it the required permissions. This might help:
http://vyaskn.tripod.com/generate_sc..._sql_tasks.htm
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
news:OHbd5VmvEHA.3624@.TK2MSFTNGP09.phx.gbl...
> We have a rule for developing database-driven applications that all
> interaction with the database must be done through stored procedures i.e.
> all selects, inserts, updates etc.
> I am looking for simple ways to enforce & support this design principle -
> and one would be if I could put the SQL login that the application uses
into
> a database role(s) that only allowed execution of stored procedure, i.e.
no
> direct access to tables or views. I know that the long way to do this is
to
> create my own role and grant it execute rights on each SP and no rights to
> tables/views, but I was wondering if there was anything already built into
> SQL Server.
>
|||This might help as well
Granting execute permissions to all stored procedures in a database
http://www.sqldbatips.com/showarticle.asp?ID=8
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
news:OHbd5VmvEHA.3624@.TK2MSFTNGP09.phx.gbl...
> We have a rule for developing database-driven applications that all
> interaction with the database must be done through stored procedures i.e.
> all selects, inserts, updates etc.
> I am looking for simple ways to enforce & support this design principle -
> and one would be if I could put the SQL login that the application uses
> into a database role(s) that only allowed execution of stored procedure,
> i.e. no direct access to tables or views. I know that the long way to do
> this is to create my own role and grant it execute rights on each SP and
> no rights to tables/views, but I was wondering if there was anything
> already built into SQL Server.
>
|||Thanks, that is useful.
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:OF8hIIrvEHA.1392@.TK2MSFTNGP14.phx.gbl...
> This might help as well
> Granting execute permissions to all stored procedures in a database
> http://www.sqldbatips.com/showarticle.asp?ID=8
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
> news:OHbd5VmvEHA.3624@.TK2MSFTNGP09.phx.gbl...
>

Database Role that allows execution of stored procedures?

We have a rule for developing database-driven applications that all
interaction with the database must be done through stored procedures i.e.
all selects, inserts, updates etc.
I am looking for simple ways to enforce & support this design principle -
and one would be if I could put the SQL login that the application uses into
a database role(s) that only allowed execution of stored procedure, i.e. no
direct access to tables or views. I know that the long way to do this is to
create my own role and grant it execute rights on each SP and no rights to
tables/views, but I was wondering if there was anything already built into
SQL Server.No built-in role like that in SQL Server 2000. You'll have to create your
own database role, and give it the required permissions. This might help:
http://vyaskn.tripod.com/generate_s...e_sql_tasks.htm
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
news:OHbd5VmvEHA.3624@.TK2MSFTNGP09.phx.gbl...
> We have a rule for developing database-driven applications that all
> interaction with the database must be done through stored procedures i.e.
> all selects, inserts, updates etc.
> I am looking for simple ways to enforce & support this design principle -
> and one would be if I could put the SQL login that the application uses
into
> a database role(s) that only allowed execution of stored procedure, i.e.
no
> direct access to tables or views. I know that the long way to do this is
to
> create my own role and grant it execute rights on each SP and no rights to
> tables/views, but I was wondering if there was anything already built into
> SQL Server.
>|||This might help as well
Granting execute permissions to all stored procedures in a database
http://www.sqldbatips.com/showarticle.asp?ID=8
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
news:OHbd5VmvEHA.3624@.TK2MSFTNGP09.phx.gbl...
> We have a rule for developing database-driven applications that all
> interaction with the database must be done through stored procedures i.e.
> all selects, inserts, updates etc.
> I am looking for simple ways to enforce & support this design principle -
> and one would be if I could put the SQL login that the application uses
> into a database role(s) that only allowed execution of stored procedure,
> i.e. no direct access to tables or views. I know that the long way to do
> this is to create my own role and grant it execute rights on each SP and
> no rights to tables/views, but I was wondering if there was anything
> already built into SQL Server.
>|||Thanks, that is useful.
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:OF8hIIrvEHA.1392@.TK2MSFTNGP14.phx.gbl...
> This might help as well
> Granting execute permissions to all stored procedures in a database
> http://www.sqldbatips.com/showarticle.asp?ID=8
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
> news:OHbd5VmvEHA.3624@.TK2MSFTNGP09.phx.gbl...
>

Database Role that allows execution of stored procedures?

We have a rule for developing database-driven applications that all
interaction with the database must be done through stored procedures i.e.
all selects, inserts, updates etc.
I am looking for simple ways to enforce & support this design principle -
and one would be if I could put the SQL login that the application uses into
a database role(s) that only allowed execution of stored procedure, i.e. no
direct access to tables or views. I know that the long way to do this is to
create my own role and grant it execute rights on each SP and no rights to
tables/views, but I was wondering if there was anything already built into
SQL Server.No built-in role like that in SQL Server 2000. You'll have to create your
own database role, and give it the required permissions. This might help:
http://vyaskn.tripod.com/generate_scripts_repetitive_sql_tasks.htm
--
Vyas, MVP (SQL Server)
SQL Server Articles and Code Samples @. http://vyaskn.tripod.com/
"Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
news:OHbd5VmvEHA.3624@.TK2MSFTNGP09.phx.gbl...
> We have a rule for developing database-driven applications that all
> interaction with the database must be done through stored procedures i.e.
> all selects, inserts, updates etc.
> I am looking for simple ways to enforce & support this design principle -
> and one would be if I could put the SQL login that the application uses
into
> a database role(s) that only allowed execution of stored procedure, i.e.
no
> direct access to tables or views. I know that the long way to do this is
to
> create my own role and grant it execute rights on each SP and no rights to
> tables/views, but I was wondering if there was anything already built into
> SQL Server.
>|||This might help as well
Granting execute permissions to all stored procedures in a database
http://www.sqldbatips.com/showarticle.asp?ID=8
--
HTH
Jasper Smith (SQL Server MVP)
http://www.sqldbatips.com
I support PASS - the definitive, global
community for SQL Server professionals -
http://www.sqlpass.org
"Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
news:OHbd5VmvEHA.3624@.TK2MSFTNGP09.phx.gbl...
> We have a rule for developing database-driven applications that all
> interaction with the database must be done through stored procedures i.e.
> all selects, inserts, updates etc.
> I am looking for simple ways to enforce & support this design principle -
> and one would be if I could put the SQL login that the application uses
> into a database role(s) that only allowed execution of stored procedure,
> i.e. no direct access to tables or views. I know that the long way to do
> this is to create my own role and grant it execute rights on each SP and
> no rights to tables/views, but I was wondering if there was anything
> already built into SQL Server.
>|||Thanks, that is useful.
"Jasper Smith" <jasper_smith9@.hotmail.com> wrote in message
news:OF8hIIrvEHA.1392@.TK2MSFTNGP14.phx.gbl...
> This might help as well
> Granting execute permissions to all stored procedures in a database
> http://www.sqldbatips.com/showarticle.asp?ID=8
> --
> HTH
> Jasper Smith (SQL Server MVP)
> http://www.sqldbatips.com
> I support PASS - the definitive, global
> community for SQL Server professionals -
> http://www.sqlpass.org
> "Laurence Neville" <laurenceneville@.hotmail.com> wrote in message
> news:OHbd5VmvEHA.3624@.TK2MSFTNGP09.phx.gbl...
>> We have a rule for developing database-driven applications that all
>> interaction with the database must be done through stored procedures i.e.
>> all selects, inserts, updates etc.
>> I am looking for simple ways to enforce & support this design principle -
>> and one would be if I could put the SQL login that the application uses
>> into a database role(s) that only allowed execution of stored procedure,
>> i.e. no direct access to tables or views. I know that the long way to do
>> this is to create my own role and grant it execute rights on each SP and
>> no rights to tables/views, but I was wondering if there was anything
>> already built into SQL Server.
>

DataBase reusability

Hello,
I am developing several database centric applications.
Each application has gotten one or more databases. I
discovered that some applications share some
functionalities around database tables. For example,
Application A will query the Members, Groups,
MemberPreferences tables in database A, and Application
B queries the Members, Groups, MemberPreferences tables
in database B. Those tables named Members, Groups, and
MemberPreferences have the identical table schema, and
have the same select/insert/update/delete stored
procedures, and triggers.
Is there any good solution to maintain those kind of
databases easily? Using the data import/export provided
by the SQL Enterprise Manager might help a bit. Any
other efficient alternatives to synchronize the table
schema and stored procedures among those databases?
W. JordanW,Jordan
Are there any reasons to have two databases if as you said they have the
same table's structure?
use master
create table t(c1 varchar(50)) insert t values('master')
go
create proc sp_test as select * from t
GO
use northwind
create table t(c1 varchar(50)) insert t values('northwind')
use pubs
create table t(c1 varchar(50)) insert t values('pubs')
use pubs
exec sp_test --returns 'master'
use master
exec sp_MS_marksystemobject sp_test
use pubs
exec sp_test --returns 'pubs'
use northwind
exec sp_test --returns 'northwind'
"W. Jordan" <wmjordan@.163.com.spam.proof> wrote in message
news:OUhzd6VHFHA.2936@.TK2MSFTNGP15.phx.gbl...
> Hello,
> I am developing several database centric applications.
> Each application has gotten one or more databases. I
> discovered that some applications share some
> functionalities around database tables. For example,
> Application A will query the Members, Groups,
> MemberPreferences tables in database A, and Application
> B queries the Members, Groups, MemberPreferences tables
> in database B. Those tables named Members, Groups, and
> MemberPreferences have the identical table schema, and
> have the same select/insert/update/delete stored
> procedures, and triggers.
> Is there any good solution to maintain those kind of
> databases easily? Using the data import/export provided
> by the SQL Enterprise Manager might help a bit. Any
> other efficient alternatives to synchronize the table
> schema and stored procedures among those databases?
> W. Jordan
>|||check out DB Ghost (http://www.dbghost.com)
"W. Jordan" wrote:

> Hello,
> I am developing several database centric applications.
> Each application has gotten one or more databases. I
> discovered that some applications share some
> functionalities around database tables. For example,
> Application A will query the Members, Groups,
> MemberPreferences tables in database A, and Application
> B queries the Members, Groups, MemberPreferences tables
> in database B. Those tables named Members, Groups, and
> MemberPreferences have the identical table schema, and
> have the same select/insert/update/delete stored
> procedures, and triggers.
> Is there any good solution to maintain those kind of
> databases easily? Using the data import/export provided
> by the SQL Enterprise Manager might help a bit. Any
> other efficient alternatives to synchronize the table
> schema and stored procedures among those databases?
> W. Jordan
>
>|||Hello Uri,
Yes, the database items with similar structure are used by different
applications, although, which share some identical behaviors.
We are developing several applications on a single centric machine.
For portability on a development machine, I obviously can not have
those applications sharing one table in one database since the data
will get conflicted.
Using the master table is a trick for stored procedures. But, is it a
good practice to do so?
Best Regards,
W. Jordan
"Uri Dimant" <urid@.iscar.co.il> wrote in message
news:#RGY3LWHFHA.2936@.TK2MSFTNGP15.phx.gbl...
: W,Jordan
: Are there any reasons to have two databases if as you said they have the
: same table's structure?
:
: use master
: create table t(c1 varchar(50)) insert t values('master')
: go
: create proc sp_test as select * from t
: GO
: use northwind
: create table t(c1 varchar(50)) insert t values('northwind')
: use pubs
: create table t(c1 varchar(50)) insert t values('pubs')
: use pubs
: exec sp_test --returns 'master'
: use master
: exec sp_MS_marksystemobject sp_test
: use pubs
: exec sp_test --returns 'pubs'
: use northwind
: exec sp_test --returns 'northwind'
:
:
:
: "W. Jordan" <wmjordan@.163.com.spam.proof> wrote in message
: news:OUhzd6VHFHA.2936@.TK2MSFTNGP15.phx.gbl...
: > Hello,
: >
: > I am developing several database centric applications.
: > Each application has gotten one or more databases. I
: > discovered that some applications share some
: > functionalities around database tables. For example,
: > Application A will query the Members, Groups,
: > MemberPreferences tables in database A, and Application
: > B queries the Members, Groups, MemberPreferences tables
: > in database B. Those tables named Members, Groups, and
: > MemberPreferences have the identical table schema, and
: > have the same select/insert/update/delete stored
: > procedures, and triggers.
: >
: > Is there any good solution to maintain those kind of
: > databases easily? Using the data import/export provided
: > by the SQL Enterprise Manager might help a bit. Any
: > other efficient alternatives to synchronize the table
: > schema and stored procedures among those databases?
: >
: > W. Jordan
: >
: >
:
:|||Hello Mark,
DB Ghost seems to be able to solve my problem.
But I think that is not a thing we can afford.
Best Regards,
W. Jordan
"mark baekdal" <markbaekdal@.discussions.microsoft.com>
wrote in message
news:A9386D77-1460-40D7-AD10-E00438E096EC@.microsoft.com...
: check out DB Ghost (http://www.dbghost.com)
:
:|||Hello Welman.
the question could also be "Can you afford not to have it?". What ever you
decide thanks for looking.
regards,
Mark Baekdal
http://www.dbghost.com
http://www.innovartis.co.uk
+44 (0)208 241 1762
Database change management for SQL Server
"Welman Jordan" wrote:

> Hello Mark,
> DB Ghost seems to be able to solve my problem.
> But I think that is not a thing we can afford.
> --
> Best Regards,
> W. Jordan
>
> "mark baekdal" <markbaekdal@.discussions.microsoft.com>
> wrote in message
> news:A9386D77-1460-40D7-AD10-E00438E096EC@.microsoft.com...
> : check out DB Ghost (http://www.dbghost.com)
> :
> :
>
>

Saturday, February 25, 2012

Database Replication

we have setup a sql2005 server for reporting. we want to replicate the
transaction databases which used for live applications to that server such
that all reports will be generated in that server.
This reporting server is supposed read-only and with let's say 30 mins delay
from production data.
With this requirement, should we use the transactional replication or there
any method?
Thanks,
Ryan
Ryan,
transactional replication is often used for this type of reporting
requirement. You could also enhance the system by using the snapshot
committed isolation levels to maintain access while the distribution agent
is running. The main 'competitor' technology on SQL Server 2005 is database
mirroring with database snapshots. There's no detailed list of pros and
cons, but as I'm a replication guy I'll point out that mirroring doesn't
support FTI and you can't take back ups of snapshots
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Paul-
I have client who maintains a local SQL 2005 database which has
numerous bulk updates applied throughout the day. They wish to
replicate (most of) this data to their web host which is in another
city. They are trying to decide whether to use Transactional
Replication or once-per-day Merge Replication. (Concurrency is not a
big issue here).
What method would you recommend? What are the most important
considerations?
Thanks,
Paul
Paul Ibison wrote:
> Ryan,
> transactional replication is often used for this type of reporting
> requirement. You could also enhance the system by using the snapshot
> committed isolation levels to maintain access while the distribution agent
> is running. The main 'competitor' technology on SQL Server 2005 is database
> mirroring with database snapshots. There's no detailed list of pros and
> cons, but as I'm a replication guy I'll point out that mirroring doesn't
> support FTI and you can't take back ups of snapshots
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Merge is generally slower. If there are numerous updates to the same row,
then it can approach transactional times, but I have rarely seen cases of
someone claiming it to be faster. It's geared up for offline updates at teh
subscriber and conflict resolution, neither of which you'll need. I'd
definitely go with transactional.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Thanks, Paul!
Does Transactional require an "always on" connection to the subscriber?
Paul Ibison wrote:
> Merge is generally slower. If there are numerous updates to the same row,
> then it can approach transactional times, but I have rarely seen cases of
> someone claiming it to be faster. It's geared up for offline updates at teh
> subscriber and conflict resolution, neither of which you'll need. I'd
> definitely go with transactional.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||No - as long as there is a connection when the distribution agent is
scheduled to run you're ok (different for immediate updating subs but not
relevant in your case).
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Paul, thanks a lot!
Do you know any limitation on using transactional replication? eg the min
delay time, can it perform query during the replication.
Aslo how's the overhead on resources of compare to mirroring? Is it require
many resources (eg. CPU and RAM) during the processing?
Regards,
Ryan
"Paul Ibison" wrote:

> Ryan,
> transactional replication is often used for this type of reporting
> requirement. You could also enhance the system by using the snapshot
> committed isolation levels to maintain access while the distribution agent
> is running. The main 'competitor' technology on SQL Server 2005 is database
> mirroring with database snapshots. There's no detailed list of pros and
> cons, but as I'm a replication guy I'll point out that mirroring doesn't
> support FTI and you can't take back ups of snapshots
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>
|||Ryan,
I've been using transactional replication at my current employer for years
and latency will always be determined by geographic region and equipment.
In my case I'm seeing less than 5 second latency, usually lower than 2, and
yes, of course you can run queries on the data that is being replicated.
Resources are minimal once replication is setup, during the initial
snapshot, the only issues you might run into are the locking of the tables
as they are processed for replication.
Adam P. Cassidy
"Ryan" <Ryan@.discussions.microsoft.com> wrote in message
news:D4AA35E2-CBA7-4052-93AB-37DF213D729D@.microsoft.com...[vbcol=seagreen]
> Paul, thanks a lot!
> Do you know any limitation on using transactional replication? eg the min
> delay time, can it perform query during the replication.
> Aslo how's the overhead on resources of compare to mirroring? Is it
> require
> many resources (eg. CPU and RAM) during the processing?
> Regards,
> Ryan
>
> "Paul Ibison" wrote:
|||Ryan,
I agree with Adam, but just to clarify, if you mean queries applied to the
publisher then there' s no issue, but if the query is to the subscriber, you
might experience the normal blocking issues. The new snapshot isolation
level can be of use here. I have no stats regarding the performance
comparison between database mirroring and replication as yet.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com .
|||Yes agreed. Sorry for not clarifying. We replicate for Cognos reporting
and since non of the reports are require a committed state, we have all the
queries executed against the replicated data as read uncommitted and there
are no problems - definitely a point I should have made.
Adam
"Paul Ibison" <Paul.Ibison@.Pygmalion.Com> wrote in message
news:OhCAQbWFHHA.1816@.TK2MSFTNGP06.phx.gbl...
> Ryan,
> I agree with Adam, but just to clarify, if you mean queries applied to the
> publisher then there' s no issue, but if the query is to the subscriber,
> you might experience the normal blocking issues. The new snapshot
> isolation level can be of use here. I have no stats regarding the
> performance comparison between database mirroring and replication as yet.
> Cheers,
> Paul Ibison SQL Server MVP, www.replicationanswers.com .
>
>

Database Replication

Hi,
I'm learning Database Replication. what's the Database Replication for? what
applications use this feature? Please advice.Hi
Have you read the section "Introducing Replication" in Books Online?
Hillary Cotter has a book on replication
http://www.nwsu.com/0974973602­.html which may help if you proceed along
this route.
John
"js" <js@.someone@.hotmail.com> wrote in message
news:OkY%233g0TFHA.228@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm learning Database Replication. what's the Database Replication for?
> what applications use this feature? Please advice.
>|||For having the same (or nearly the same) data in different places.
The most obvious example is a salesperson wanting to have a subset of the
the sales database on his laptop with the ability to make changes locally
and then have those changes get synchronized into the corporate database
when he re-connects to the LAN.
Also frequently used in Reporting Server situations, where the main
transactional database is too busy to serve up large queries for reports.
One way replication ships the data to a db that the reports are run off.
HTH,
--
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
www.DallasDBAs.com/forum - new DB forum for Dallas/Ft. Worth area DBAs.
"js" <js@.someone@.hotmail.com> wrote in message
news:OkY%233g0TFHA.228@.TK2MSFTNGP12.phx.gbl...
> Hi,
> I'm learning Database Replication. what's the Database Replication for?
> what applications use this feature? Please advice.
>|||Thanks all...|||"Kevin3NF" wrote in message
> For having the same (or nearly the same) data in different places.
> The most obvious example is a salesperson wanting to have a subset of the
> the sales database on his laptop with the ability to make changes locally
> and then have those changes get synchronized into the corporate database
> when he re-connects to the LAN.
> Also frequently used in Reporting Server situations, where the main
> transactional database is too busy to serve up large queries for reports.
> One way replication ships the data to a db that the reports are run off.
>
Thanks Kevin, There are good sample, easy to understand.
How about Analysis Services? Can you please give me some samples too.|||When the CEO wants to know how many widgets were sold in the NorthEast
district in Q4, 2004...he's going to open up Excel, connect to the Analysis
Services database and select those parameters. Very easy and he doesn't
have to know any programming.
Lots of work goes into making that AS database, form bringing the data in,
to getting it ready for the boss to start slicing and dicing.
I've never played in that area, so my knowledge is limited. I am pitching a
project that involves this, so ping me in early 2006...I should be much more
well-versed by then :-)
--
Kevin Hill
President
3NF Consulting
www.3nf-inc.com/NewsGroups.htm
www.DallasDBAs.com/forum - new DB forum for Dallas/Ft. Worth area DBAs.
"js" <js@.someone@.hotmail.com> wrote in message
news:uqiB5q1TFHA.3584@.TK2MSFTNGP14.phx.gbl...
> "Kevin3NF" wrote in message
>> For having the same (or nearly the same) data in different places.
>> The most obvious example is a salesperson wanting to have a subset of the
>> the sales database on his laptop with the ability to make changes locally
>> and then have those changes get synchronized into the corporate database
>> when he re-connects to the LAN.
>> Also frequently used in Reporting Server situations, where the main
>> transactional database is too busy to serve up large queries for reports.
>> One way replication ships the data to a db that the reports are run off.
> Thanks Kevin, There are good sample, easy to understand.
> How about Analysis Services? Can you please give me some samples too.
>
>|||Thanks Kevin...

Tuesday, February 14, 2012

Database Ownership

Dear Support,
Upon knowing the cross database chaining option in SP3 on SQL2000 Server, I
finally understood why I had troubles on our applications last year. I took
a 'giant' step to work around the issue last time and it is about time I sh
ould make it right now. I
am hoping if you could share some thought and have your comments on the foll
owing live scenario.
1. I have 3 databases(say A,B and C) and they are required together to serv
e 3 applications or 3 login users through Access's ADPs(say a,b and c). Each
frontend application is designed and programmed to update only on its own d
atabase, but they are allow
ed to pull data from the other two databases. For example, 'a' could read/w
rite on A database, but readonly on B and C database.
My SQL Server is in Windows Authentication mode. Say, if I make changes to
three users(again a,b,c) of their database access setting on database A,B an
d C by declaring all of them(a,b,c) to be the owner (dbo) of all three datab
ases, my first question is,
can I declare database ownership on more than one users, or say, can one dat
abase or its objects be owned by more than one login?
Second, from a performance standpoint, there will be no 'broken link' if I a
m correct, and may I assume the response time will be better to users?
Third, if all a,b,c users are all database owners, or say 'a' owns A,B,C dat
abase, and so as 'b' also owns A,B,C database, am I correct that I will lose
the capability to fine tuning the permission setting on database objects (s
uch as stored procedure exe
c., r/w on tables/fields) at database level on each database?
I know I should stop here but the cross database chaining concept is getting
very interesting to me as a DBA/Programmer and the scenario I brought up he
r is all I am facing in my shop. I hope you could pardon me by allowing me
to continue bring up the fo
llowing of my concerns:
If, say, I decide to integrate all three (a,b,c) applications into one, say
BigBoy, this new BigBoy will have read and write functions/buttons on all A,
B and C database. Now, the original users of a,b,c are now using only one a
pplication, the BigBoy. If
I want to fine tuning the read and write permissions on databases without re
lying on the fronend applications, am I correct to remove the dbowner role f
rom each of the login of the a,b,c user, and use/click the select, update,ex
ec, etc. on the object lis
t from the permission screen for each user?
2. May I assume that the three users(a,b,c) I refer to above, can be replac
ed by or applied to Window's user defined group?
3. My orginal intention is to use Role instead of group for setting the new
permission scheme, but I was told the Role can not span across databases.
Would you confirm on this, or if there is a workaround on Role? The reason
I try to use Role because m
y shop has Network administration personnel and I could separate security ta
sks between Network Admin and DB Admin by using user defined DB Role.
Thank you for looking into this matter.
Martin> my first question is, can I declare database ownership on more than one
users, or say, can one database or its objects be owned by more than one
login?
A database may be owned by only one login.
quote:

> Second, from a performance standpoint, there will be no 'broken link' if I

am correct, and may I assume the response time will be better to users?
An unbroken ownership chain eliminates extra security checking but I don't
believe the performance difference is noticeable for most applications. A
significant benefit of an unbroken ownership chain is that permissions on
referenced objects are not needed. This allows you can restrict access to
data through views and procedures. In a multi-database environment like
yours, you could create views referencing tables in the other databases and
then grant select permissions on the views.
quote:

> Third, if all a,b,c users are all database owners, or say 'a' owns A,B,C

database, and so as 'b' also owns A,B,C database, am I correct that I will
lose the capability to fine tuning the permission setting on database
objects (such as stored procedure exec., r/w on tables/fields) at database
level on each database?
You cannot deny permissions from the database owner. The database owner has
full permissions on all objects within the database.
quote:

> I know I should stop here but the cross database chaining concept is

getting very interesting to me as a DBA/Programmer and the scenario I
brought up her is all I am facing in my shop. I hope you could pardon me by
allowing me to continue bring up the following of my concerns:
quote:

> If, say, I decide to integrate all three (a,b,c) applications into one,

say BigBoy, this new BigBoy will have read and write functions/buttons on
all A,B and C database. Now, the original users of a,b,c are now using only
one application, the BigBoy. If I want to fine tuning the read and write
permissions on databases without relying on the fronend applications, am I
correct to remove the dbowner role from each of the login of the a,b,c user,
and use/click the select, update,exec, etc. on the object list from the
permission screen for each user?
The dbo user and the db_owner role have powerful permissions that are not
normally needed for application access. A best practice is to grant needed
object permissions to roles so that you can control security through user
role membership. This provides more control over permissions.
quote:

> 2. May I assume that the three users(a,b,c) I refer to above, can be

replaced by or applied to Window's user defined group?
Yes.
quote:

> 3. My orginal intention is to use Role instead of group for setting the

new permission scheme, but I was told the Role can not span across
databases. Would you confirm on this, or if there is a workaround on Role?
The reason I try to use Role because my shop has Network administration
personnel and I could separate security tasks between Network Admin and DB
Admin by using user defined DB Role.
Database roles and database users are specific to a particular database but
this really isn't a big deal since you can setup role permissions once and
then control access through role membership. Cross-database chaining
enables you to implement referencing views so that you don't need to create
roles in the other databases. However the logins still need access to the
other databases, either directly or via the guest user security context.
The scripts below illustrates how you can set this up.
-- setup role security with cross-database chaining
USE A
EXEC sp_changedbowner 'MyLogin'
EXEC sp_dboption 'A', 'db chaining', true
EXEC sp_addRole 'ApplicationA'
GRANT ALL ON MyTable TO ApplicationA
GRANT ALL ON MyProc TO ApplicationA
GRANT SELECT ON MyDatabaseB_MyTable_View TO ApplicationA
GRANT SELECT ON MyDatabaseC_MyTable_View TO ApplicationA
GO
USE B
EXEC sp_changedbowner 'MyLogin'
EXEC sp_dboption 'B', 'db chaining', true
EXEC sp_addRole 'ApplicationB'
GRANT ALL ON MyTable TO ApplicationB
GRANT ALL ON MyProc TO ApplicationB
GRANT SELECT ON MyDatabaseA_MyTable_View TO ApplicationB
GRANT SELECT ON MyDatabaseC_MyTable_View TO ApplicationB
GO
USE C
EXEC sp_changedbowner 'MyLogin'
EXEC sp_dboption 'C', 'db chaining', true
EXEC sp_addRole 'ApplicationC'
GRANT ALL ON MyTable TO ApplicationC
GRANT ALL ON MyProc TO ApplicationC
GRANT SELECT ON MyDatabaseA_MyTable_View TO ApplicationC
GRANT SELECT ON MyDatabaseB_MyTable_View TO ApplicationC
GO
-- user setup with cross-database chaining without guest user
EXEC A..sp_grantdbaccess 'MyDomain\UserA'
EXEC A..sp_grantdbaccess 'MyDomain\UserB'
EXEC A..sp_grantdbaccess 'MyDomain\UserC'
EXEC A..sp_addrolemember 'ApplicationA', 'MyDomain\UserA'
EXEC B..sp_grantdbaccess 'MyDomain\UserA'
EXEC B..sp_grantdbaccess 'MyDomain\UserB'
EXEC B..sp_grantdbaccess 'MyDomain\UserC'
EXEC B..sp_addrolemember 'ApplicationB', 'MyDomain\UserB'
EXEC C..sp_grantdbaccess 'MyDomain\UserA'
EXEC C..sp_grantdbaccess 'MyDomain\UserB'
EXEC C..sp_grantdbaccess 'MyDomain\UserC'
EXEC C..sp_addrolemember 'ApplicationC', 'MyDomain\UserC'
GO
-- user setup with cross-database chaining and guest user in each database
GO
EXEC A..sp_grantdbaccess 'MyDomain\UserA'
EXEC A..sp_addrolemember 'ApplicationA', 'MyDomain\UserA'
EXEC B..sp_grantdbaccess 'MyDomain\UserB'
EXEC B..sp_addrolemember 'ApplicationB', 'MyDomain\UserB'
EXEC C..sp_grantdbaccess 'MyDomain\UserC'
EXEC C..sp_addrolemember 'ApplicationC', 'MyDomain\UserC'
GO
Hope this helps.
Dan Guzman
SQL Server MVP
"Martin" <anonymous@.discussions.microsoft.com> wrote in message
news:2E80551C-9C11-43E6-9457-98EA275B4A2E@.microsoft.com...
quote:

> Dear Support,
> Upon knowing the cross database chaining option in SP3 on SQL2000 Server,

I finally understood why I had troubles on our applications last year. I
took a 'giant' step to work around the issue last time and it is about time
I should make it right now. I am hoping if you could share some thought and
have your comments on the following live scenario.
quote:

> 1. I have 3 databases(say A,B and C) and they are required together to

serve 3 applications or 3 login users through Access's ADPs(say a,b and c).
Each frontend application is designed and programmed to update only on its
own database, but they are allowed to pull data from the other two
databases. For example, 'a' could read/write on A database, but readonly on
B and C database.
quote:

> My SQL Server is in Windows Authentication mode. Say, if I make changes

to three users(again a,b,c) of their database access setting on database A,B
and C by declaring all of them(a,b,c) to be the owner (dbo) of all three
databases, my first question is, can I declare database ownership on more
than one users, or say, can one database or its objects be owned by more
than one login?
quote:

> Second, from a performance standpoint, there will be no 'broken link' if I

am correct, and may I assume the response time will be better to users?
quote:

> Third, if all a,b,c users are all database owners, or say 'a' owns A,B,C

database, and so as 'b' also owns A,B,C database, am I correct that I will
lose the capability to fine tuning the permission setting on database
objects (such as stored procedure exec., r/w on tables/fields) at database
level on each database?
quote:

> I know I should stop here but the cross database chaining concept is

getting very interesting to me as a DBA/Programmer and the scenario I
brought up her is all I am facing in my shop. I hope you could pardon me by
allowing me to continue bring up the following of my concerns:
quote:

> If, say, I decide to integrate all three (a,b,c) applications into one,

say BigBoy, this new BigBoy will have read and write functions/buttons on
all A,B and C database. Now, the original users of a,b,c are now using only
one application, the BigBoy. If I want to fine tuning the read and write
permissions on databases without relying on the fronend applications, am I
correct to remove the dbowner role from each of the login of the a,b,c user,
and use/click the select, update,exec, etc. on the object list from the
permission screen for each user?
quote:

> 2. May I assume that the three users(a,b,c) I refer to above, can be

replaced by or applied to Window's user defined group?
quote:

> 3. My orginal intention is to use Role instead of group for setting the

new permission scheme, but I was told the Role can not span across
databases. Would you confirm on this, or if there is a workaround on Role?
The reason I try to use Role because my shop has Network administration
personnel and I could separate security tasks between Network Admin and DB
Admin by using user defined DB Role.
quote:

> Thank you for looking into this matter.
> Martin
>

Database Ownership

Dear Support
Upon knowing the cross database chaining option in SP3 on SQL2000 Server, I finally understood why I had troubles on our applications last year. I took a 'giant' step to work around the issue last time and it is about time I should make it right now. I am hoping if you could share some thought and have your comments on the following live scenario
1. I have 3 databases(say A,B and C) and they are required together to serve 3 applications or 3 login users through Access's ADPs(say a,b and c). Each frontend application is designed and programmed to update only on its own database, but they are allowed to pull data from the other two databases. For example, 'a' could read/write on A database, but readonly on B and C database
My SQL Server is in Windows Authentication mode. Say, if I make changes to three users(again a,b,c) of their database access setting on database A,B and C by declaring all of them(a,b,c) to be the owner (dbo) of all three databases, my first question is, can I declare database ownership on more than one users, or say, can one database or its objects be owned by more than one login?
Second, from a performance standpoint, there will be no 'broken link' if I am correct, and may I assume the response time will be better to users?
Third, if all a,b,c users are all database owners, or say 'a' owns A,B,C database, and so as 'b' also owns A,B,C database, am I correct that I will lose the capability to fine tuning the permission setting on database objects (such as stored procedure exec., r/w on tables/fields) at database level on each database
I know I should stop here but the cross database chaining concept is getting very interesting to me as a DBA/Programmer and the scenario I brought up her is all I am facing in my shop. I hope you could pardon me by allowing me to continue bring up the following of my concerns
If, say, I decide to integrate all three (a,b,c) applications into one, say BigBoy, this new BigBoy will have read and write functions/buttons on all A,B and C database. Now, the original users of a,b,c are now using only one application, the BigBoy. If I want to fine tuning the read and write permissions on databases without relying on the fronend applications, am I correct to remove the dbowner role from each of the login of the a,b,c user, and use/click the select, update,exec, etc. on the object list from the permission screen for each user
2. May I assume that the three users(a,b,c) I refer to above, can be replaced by or applied to Window's user defined group?
3. My orginal intention is to use Role instead of group for setting the new permission scheme, but I was told the Role can not span across databases. Would you confirm on this, or if there is a workaround on Role? The reason I try to use Role because my shop has Network administration personnel and I could separate security tasks between Network Admin and DB Admin by using user defined DB Role
Thank you for looking into this matter
MartinAnswered in security. Please don't post the same question independently to
multiple groups.
--
Hope this helps.
Dan Guzman
SQL Server MVP
"Martin" <anonymous@.discussions.microsoft.com> wrote in message
news:6B0EF357-1938-437E-886D-1614BF004B5E@.microsoft.com...
> Dear Support,
> Upon knowing the cross database chaining option in SP3 on SQL2000 Server,
I finally understood why I had troubles on our applications last year. I
took a 'giant' step to work around the issue last time and it is about time
I should make it right now. I am hoping if you could share some thought and
have your comments on the following live scenario.
> 1. I have 3 databases(say A,B and C) and they are required together to
serve 3 applications or 3 login users through Access's ADPs(say a,b and c).
Each frontend application is designed and programmed to update only on its
own database, but they are allowed to pull data from the other two
databases. For example, 'a' could read/write on A database, but readonly on
B and C database.
> My SQL Server is in Windows Authentication mode. Say, if I make changes
to three users(again a,b,c) of their database access setting on database A,B
and C by declaring all of them(a,b,c) to be the owner (dbo) of all three
databases, my first question is, can I declare database ownership on more
than one users, or say, can one database or its objects be owned by more
than one login?
> Second, from a performance standpoint, there will be no 'broken link' if I
am correct, and may I assume the response time will be better to users?
> Third, if all a,b,c users are all database owners, or say 'a' owns A,B,C
database, and so as 'b' also owns A,B,C database, am I correct that I will
lose the capability to fine tuning the permission setting on database
objects (such as stored procedure exec., r/w on tables/fields) at database
level on each database?
> I know I should stop here but the cross database chaining concept is
getting very interesting to me as a DBA/Programmer and the scenario I
brought up her is all I am facing in my shop. I hope you could pardon me by
allowing me to continue bring up the following of my concerns:
> If, say, I decide to integrate all three (a,b,c) applications into one,
say BigBoy, this new BigBoy will have read and write functions/buttons on
all A,B and C database. Now, the original users of a,b,c are now using only
one application, the BigBoy. If I want to fine tuning the read and write
permissions on databases without relying on the fronend applications, am I
correct to remove the dbowner role from each of the login of the a,b,c user,
and use/click the select, update,exec, etc. on the object list from the
permission screen for each user?
> 2. May I assume that the three users(a,b,c) I refer to above, can be
replaced by or applied to Window's user defined group?
> 3. My orginal intention is to use Role instead of group for setting the
new permission scheme, but I was told the Role can not span across
databases. Would you confirm on this, or if there is a workaround on Role?
The reason I try to use Role because my shop has Network administration
personnel and I could separate security tasks between Network Admin and DB
Admin by using user defined DB Role.
> Thank you for looking into this matter.
> Martin