Showing posts with label text. Show all posts
Showing posts with label text. Show all posts

Monday, March 12, 2012

Login Audit

I'd like to keep track of the number of logins to a SQL server over a
day which are then logged in a simple text file, for licensing
reasons. What do you think is the best way to do this? I was thinking
of using a trace but fear this may generate too much info. Could I
schedule a stored procedure to run every hour which records the number
and exports to a text file?
Thanks for your help in advance!
JohnTurn of the Login success and failure auditing functionality of SQL Server.
This will create an entry for each event in the NT Application Eventlog,
then you use WMI to filter them out and send them to a file for example.
This will be the lowest overhead solution, using SQL Trace/Profiler has much
more impact on your server performance.
GertD@.SQLDev.Net
Please reply only to the newsgroups.
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use.
Copyright SQLDev.Net 1991-2004 All rights reserved.
"John McGinty" <jpmcginty@.talk21.com> wrote in message
news:87642ea9.0401280404.40536dde@.posting.google.com...
quote:

> I'd like to keep track of the number of logins to a SQL server over a
> day which are then logged in a simple text file, for licensing
> reasons. What do you think is the best way to do this? I was thinking
> of using a trace but fear this may generate too much info. Could I
> schedule a stored procedure to run every hour which records the number
> and exports to a text file?
> Thanks for your help in advance!
> John
|||The logins also get sent to the SQL Server errorlog as well.
Rand
This posting is provided "as is" with no warranties and confers no rights.

Friday, March 9, 2012

Login and User Problems

This is a multi-part message in MIME format.
--=_NextPart_000_0015_01C3DBB8.722998E0
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Sorry but i think i was not clear enough..
I have a SQL Server 7.0 Desktop installed in my computer. When i = restore a back up
from a SQL SERVER 7.0 Standart it, restore all tables from the database = but not logins.
When I create the logins in the Standart Edition, I created it one for = each user and sing it
by database default my database.
this users appear in the tree view, in the Database User folder. When i restore the database all there are not users, asingned in the = database...
only, Roles and, in this ones, a Public one, that contain all users that = i created.
I can't delete this users, and i can't create a new one with the same = name, because an Error
come's up..
Error 15023: User or role 'REMI'alredy esists in the current database
now i don't know what to do..
any help it will be apreciated..
Remi
--=_NextPart_000_0015_01C3DBB8.722998E0
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
&
Sorry but i think i was not clear enough..
I have a SQL Server 7.0 Desktop = installed in my computer. When i restore a back up
from a SQL SERVER 7.0 Standart it, = restore all tables from the database but not logins.
When I create the logins in the = Standart Edition, I created it one for each user and sing it
by database default my = database.
this users appear in the tree view, in = the Database User folder.
When i restore the database all there = are not users, asingned in the database...
only, Roles and, in this ones, a Public = one, that contain all users that i created.
I can't delete this users, and i can't = create a new one with the same name, because an Error
come's up..

Error 15023: User or role 'REMI'alredy = esists in the current database

now i don't know what to = do..

any help it will be = apreciated..

Remi

--=_NextPart_000_0015_01C3DBB8.722998E0--I am not sure if I understand everything, but let me try. Logins are in
master database, so it is normal they are not restored with a user database.
You can script them on the source and implement the script on the
destination server. I guess we are talking about SQL logins. You cn map them
to db users with sp_change_users_login system SP - check it in Books OnLine.
HTH,
--
Dejan Sarka, SQL Server MVP
Please reply only to the newsgroups.|||Thank you that resolve the problem...
Remi
"Dejan Sarka" <dejan_please_reply_to_newsgroups.sarka@.avtenta.si> escribió
en el mensaje news:e3MIR0$2DHA.3196@.TK2MSFTNGP11.phx.gbl...
> I am not sure if I understand everything, but let me try. Logins are in
> master database, so it is normal they are not restored with a user
database.
> You can script them on the source and implement the script on the
> destination server. I guess we are talking about SQL logins. You cn map
them
> to db users with sp_change_users_login system SP - check it in Books
OnLine.
> HTH,
> --
> Dejan Sarka, SQL Server MVP
> Please reply only to the newsgroups.
>

Monday, February 20, 2012

Logging stored Procedure changes into file

Hello all,

I have a big stored procedure which is going to alter many tables,insert data, basically lot of changes.

So, i want to have a text file (or) any log file which will display, what all the changes does the stored procedure has done ( They dont want profiler output )

Can anybody know how to log the results of execution of stored procedure to a text file.

Thanks.

Is your stored just going to run once, or many times?

If it is just a one-time batch job type thing, you could create one or more logging tables, and then have your SP do inserts into the logging table that record what was done (like before and after values, etc.)

|||

Unless you use your own logging logic within the procedure or use the profiler or the trace procedure (like the profiler) you won′t be able to do such a tracing.

Jens K. Suessmeyer

http://www.sqlserver2005.de