﻿<?xml version='1.0' encoding='UTF-8'?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>SQLServerCentral / Article Discussions / Discuss content posted by mobasha / Article Discussions by Author  / Who did what? / Latest Posts</title><generator>InstantForum.NET v2.9.0</generator><description>SQLServerCentral</description><link>http://www.sqlservercentral.com/Forums/</link><webMaster>notifications@sqlservercentral.com</webMaster><lastBuildDate>Tue, 21 May 2013 01:31:15 GMT</lastBuildDate><ttl>20</ttl><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>These scripts are for for current activity.</description><pubDate>Mon, 09 Jan 2012 09:05:24 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>HI SQL RNNR I was testing your script so just want to make sure  little thing in result set session_id is the SPID right?is there possibility with this script can show up the date and time of user . like what time they ran any query?Thanks</description><pubDate>Mon, 09 Jan 2012 07:48:41 GMT</pubDate><dc:creator>logicinside22</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>Here's another twist on the same script[code="sql"]USE MASTERGoSELECT cr.DatabaseName	,s.session_id, s.host_name, s.program_name, s.client_interface_name, s.login_name	,s.nt_domain, s.nt_user_name, c.client_net_address, c.local_net_address	,cr.ObjName	,cr.QueryFROM sys.dm_exec_sessions as sINNER JOIN sys.dm_exec_connections as c	ON c.session_id = s.session_idCROSS APPLY (SELECT db_name(dbid) AS DatabaseName,object_id(objectid) AS ObjName,ISNULL((SELECT text AS [processing-instruction(definition)]			FROM sys.dm_exec_sql_text(c.most_recent_sql_handle)			FOR XML PATH(''), TYPE		),'') as Query				FROM sys.dm_exec_sql_text(c.most_recent_sql_handle)) crORDER BY c.session_id[/code]</description><pubDate>Fri, 06 Jan 2012 16:38:43 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>Nice script indeed.</description><pubDate>Fri, 06 Jan 2012 16:15:45 GMT</pubDate><dc:creator>SQLRNNR</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>nice script ...amazing result which i want to see it.thanks</description><pubDate>Fri, 06 Jan 2012 15:32:51 GMT</pubDate><dc:creator>logicinside22</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>Very helpful script.  Thanks.  I changed it a bit to make the code cleaner.  This produces the same result:USE MASTERSELECT	s.session_id, s.host_name, s.program_name, s.client_interface_name, s.login_name	,s.nt_domain, s.nt_user_name, c.client_net_address, c.local_net_address	--,c.connection_id,c.parent_connection_id, c.most_recent_sql_handle	,(SELECT text FROM sys.dm_exec_sql_text(c.most_recent_sql_handle)) as sqlscript	,(SELECT db_name(dbid) FROM sys.dm_exec_sql_text(c.most_recent_sql_handle)) as databasename	,(SELECT object_id(objectid) FROM sys.dm_exec_sql_text(c.most_recent_sql_handle)) as objectnameFROM	sys.dm_exec_sessions as sINNER JOIN	sys.dm_exec_connections as c	ON c.session_id = s.session_id</description><pubDate>Fri, 19 Dec 2008 12:39:52 GMT</pubDate><dc:creator>Chadwick-788357</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>I like to know when who is doing in the query.Can anybody help?Thanks.Ke</description><pubDate>Mon, 27 Oct 2008 08:26:27 GMT</pubDate><dc:creator>keliu</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>Looks like good info to have. . ., but my SSMS query keeps rejecting the code. It complains about the three inline queries for the elements from dm_exec_sql_text function, doesn't like the '.' within the function argument. Is this a database compatibility issue?Any ideas?:)</description><pubDate>Mon, 28 Apr 2008 15:34:42 GMT</pubDate><dc:creator>CJensen-489142</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>Hi,Is this script for 2005 only or does it work for 2000?  Thanks.</description><pubDate>Mon, 28 Apr 2008 11:57:40 GMT</pubDate><dc:creator>TaoCanis</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>MobashA, you're welcome.</description><pubDate>Tue, 25 Mar 2008 23:53:57 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>very nice script...thnx!</description><pubDate>Tue, 25 Mar 2008 07:06:45 GMT</pubDate><dc:creator>Dugi</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>thanks all.ur solution were v.smart.thanks a lot for the help.</description><pubDate>Tue, 25 Mar 2008 00:46:58 GMT</pubDate><dc:creator>mobasha</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>I don't know any tricks to get periodic query refreshing inside SSMS, I always write a VB.net client to do this kind of stuff.</description><pubDate>Mon, 24 Mar 2008 17:39:27 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>[quote][b]mobasha (3/11/2008)[/b][hr]thanks.do any one have a solution if i need to run this select every 2 seconds?i have been trying but am stuck in a dead end.[/quote]Well, this does what you asked for, but probably is not what you want:[code]While (1=1) BEGIN	Waitfor Delay '00:00:02'	{your query's} END[/code]</description><pubDate>Mon, 24 Mar 2008 17:34:01 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>Probably should be listed under "Scripts" instead of "Articles".</description><pubDate>Mon, 24 Mar 2008 17:29:23 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>After playing with it a little this is definitely a useful query, but the article could certainly go with more explanation about what its intent is and how it functions.  That would make it a bit easier to understand.</description><pubDate>Mon, 24 Mar 2008 17:18:08 GMT</pubDate><dc:creator>timothyawiseman</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>thanks.do any one have a solution if i need to run this select every 2 seconds?i have been trying but am stuck in a dead end.</description><pubDate>Tue, 11 Mar 2008 00:48:38 GMT</pubDate><dc:creator>mobasha</dc:creator></item><item><title>RE: Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>Nice.  I will keep this one.</description><pubDate>Mon, 10 Mar 2008 11:39:35 GMT</pubDate><dc:creator>RBarryYoung</dc:creator></item><item><title>Who did what?</title><link>http://www.sqlservercentral.com/Forums/Topic466489-554-1.aspx</link><description>Comments posted to this topic are about the item [B]&lt;A HREF="/scripts/Monitoring/62467/"&gt;Who did what?&lt;/A&gt;[/B]</description><pubDate>Sun, 09 Mar 2008 23:38:18 GMT</pubDate><dc:creator>mobasha</dc:creator></item></channel></rss>