From: Mitchell_Collen via SQLMonster.com on
Hi SQL Monsters!

I am trying to run SQL Profiler from command prompt. I am using the following
command. The /M is supposed to stop the trace. However mine does not stop, it
keeps running until I manually stop the profiler. Do you know why this would
not be stopping? Note: I have tried the date with both formats.
Thanks in advance. MC

C:\> profiler /Umyusername /Pmypassword /O "myoutfile.txt" /M "2010-23-06 "13:
30:00"

_______________________________________________________________

http://msdn.microsoft.com/en-us/library/ms162808.aspx provided the following
regarding /M.

/M "MM-DD-YY hh:mm:ss"

Specifies the date and time for the trace to stop. The stop time must be
in quotes. Specify the stop time according to the parameters in the table
below:

Note: The "MM-DD-YY hh:mm:ss" format can only be used if the Use regional
settings to display date and time values option is enabled in SQL Server
Profiler. If this option is not enabled, you must use the "YYYY-MM-DD hh:mm:
ss" date and time format.
___________________________________________________

--
Misty :-)

Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/201006/1

From: Erland Sommarskog on
Mitchell_Collen via SQLMonster.com (u33726(a)uwe) writes:
> I am trying to run SQL Profiler from command prompt. I am using the
> following command. The /M is supposed to stop the trace. However mine
> does not stop, it keeps running until I manually stop the profiler. Do
> you know why this would not be stopping? Note: I have tried the date
> with both formats.
> Thanks in advance. MC
>
> C:\> profiler /Umyusername /Pmypassword /O "myoutfile.txt"
> /M "2010-23-06 "13:30:00"

In that particular example there is one quote to much, and the date is
malformed, you may want to try 2010-06-23 instead.


--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx

From: Mitchell_Collen via SQLMonster.com on
Erland Sommarskog wrote:
>> I am trying to run SQL Profiler from command prompt. I am using the
>> following command. The /M is supposed to stop the trace. However mine
>[quoted text clipped - 5 lines]
>> C:\> profiler /Umyusername /Pmypassword /O "myoutfile.txt"
>> /M "2010-23-06 "13:30:00"
>
>In that particular example there is one quote to much, and the date is
>malformed, you may want to try 2010-06-23 instead.
>
>

I tried it again. It still kicks off the profiler but will not stop using the
datetime. This is what I tried

C:\> profiler /Umyusername /Pmypassword /M "2010-06-23 09:10:00"

--
Misty :-)

Message posted via SQLMonster.com
http://www.sqlmonster.com/Uwe/Forums.aspx/sql-server/201006/1

From: Erland Sommarskog on
Mitchell_Collen via SQLMonster.com (u33726(a)uwe) writes:
> I tried it again. It still kicks off the profiler but will not stop
> using the datetime. This is what I tried
>
> C:\> profiler /Umyusername /Pmypassword /M "2010-06-23 09:10:00"

I tried this, but using /E for integrated security, and it worked. That
is, I got an error message telling me that the time has passed.

I have not checked "Use Regional Settings" in Profiler. My regional
settings are YYYY-MM-DD anyway. I changed them to DD.MM.YYYY, but
things still worked for me.

Have you checked the option in Profiler? Which regional settings do
you have?




--
Erland Sommarskog, SQL Server MVP, esquel(a)sommarskog.se

Links for SQL Server Books Online:
SQL 2008: http://msdn.microsoft.com/en-us/sqlserver/cc514207.aspx
SQL 2005: http://msdn.microsoft.com/en-us/sqlserver/bb895970.aspx
SQL 2000: http://www.microsoft.com/sql/prodinfo/previousversions/books.mspx