[quoted text, click to view] >> Is there any way to write all the events straight to a table instead of a
>>trace file and then save it as a trace table ?
SQL Server Profiler allows you to do this, however this extra functionality is not "natively" supported by the SQL Server engine. It is built in the Profiler tool by leveraging rowset (in-mem) trace. Profiler reads the stream of events from SQL Server and inserts them in a table. This is not very efficient and it is not recommended on production systems.
To create such trace, start Profiler and select File -> New Trace. After the connection to SQL Server is established, select the events you need and make sure you check the "Save to table" checkbox. The you will be asked to select database and table name.
The recommended approach is to create a server side file trace. At any time (you don't need to stop the trace on SQL Server 2005) you can load the events into a table or run queries against the file by leveraging fn_trace_gettable:
-- to query
select * from fn_trace_gettable ('file_name', default)
-- to insert in a table
select * into #foo from fn_trace_gettable ('file_name', default)
Thanks,
-Ivan
-----Original Message-----
From: Tibor Karaszi
Posted At: Wednesday, March 01, 2006 10:10 AM
Posted To: microsoft.public.sqlserver.server
Conversation: to monitor user logins/logouts
Subject: Re: to monitor user logins/logouts
[quoted text, click to view] > furthermore , is there any other method to find out who has logged in/out ?
Sure, just make certain you trace the necessary events and columns. In fact, the default Profiler trace already have these.
--
Tibor Karaszi, SQL Server MVP
http://www.karaszi.com/sqlserver/default.asp http://www.solidqualitylearning.com/ Blog:
http://solidqualitylearning.com/blogs/tibor/ [quoted text, click to view] "maxzsim via SQLMonster.com" <u14644@uwe> wrote in message news:5c960c599511d@uwe...
> Hi ,
>
> furthermore , is there any other method to find out who has logged in/out ?
>
> how abt in SQL Server 2005 , is there any tbl that captures the login/logout
> ?
>
>
> appreciate ur advise
>
> tks & rdgs
>
> maxzsim wrote:
>>Hi ,
>>
>> Is there any way to write all the events straight to a table instead of a
>>trace file and then save it as a trace table ?
>>
>>tks & rdgs
>>>The trace file grow in steps as long as the trace is running. If you stop and then close the
>>>trace,
>>>you should see the size of the file increase.
>>[quoted text clipped - 4 lines]
>>>>
>>>> tks & rdgs
>
> --