Monday, February 20, 2012

limit per user /db on SQL 2005

Hello
is there any kind of limit (connections, transactions, memory, cpu)
that can be enforced per user or per db on sql 2005 ?
Thanks
Not really. If you have multiple SQL instances you can limit resources to
each instance (or app) via WSRM which is a windows 2003 feature.
Andrew J. Kelly SQL MVP
"xav" <xavierdaull@.gmail.com> wrote in message
news:1182700179.995006.253820@.n2g2000hse.googlegro ups.com...
> Hello
> is there any kind of limit (connections, transactions, memory, cpu)
> that can be enforced per user or per db on sql 2005 ?
> Thanks
>
|||Except for with sp2, you can limit number of connections using logon triggers.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"Andrew J. Kelly" <sqlmvpnooospam@.shadhawk.com> wrote in message
news:OWy109ntHHA.3404@.TK2MSFTNGP03.phx.gbl...
> Not really. If you have multiple SQL instances you can limit resources to each instance (or app)
> via WSRM which is a windows 2003 feature.
> --
> Andrew J. Kelly SQL MVP
> "xav" <xavierdaull@.gmail.com> wrote in message
> news:1182700179.995006.253820@.n2g2000hse.googlegro ups.com...
>
|||> Except for with sp2, you can limit number of connections using logon triggers.
And how can I do it ?
|||By doing a ROLLBACK inside the trigger.
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp
http://sqlblog.com/blogs/tibor_karaszi
"xav" <xavierdaull@.gmail.com> wrote in message
news:1182862582.329249.214220@.w5g2000hsg.googlegro ups.com...
> And how can I do it ?
>
|||Thank you for your help.
Exemple found at: http://decipherinfosys.wordpress.com/2007/05/02/logon-triggers-in-sql-server-2005-sp2/
*Create a very simple login trigger */
create trigger AuditLogin_Demo
/* server means instance level*/
on all server
with execute as self
/* We specify the logon event at this stage
- If there are more than one connections,
- Issue a rollback*/
for logon
as begin
IF ORIGINAL_LOGIN()= 'AuditLogin' AND
(SELECT COUNT(*) FROM sys.dm_exec_sessions
WHERE is_user_process = 1 AND
original_login_name = 'AuditLogin') > 1
ROLLBACK;
end
go

No comments:

Post a Comment