From: Lijun Zhang on
Agree with you. I would not put tables in the watch window since it can be
any size.

Lijun


"John Bell" <jbellnewsposts(a)hotmail.com> wrote in message
news:lpdf56l54479q33okdfnpjp2f4blr6i0ne(a)4ax.com...
> On Mon, 2 Aug 2010 13:39:55 -0700, "Ryan Liu" <ryanliu_99(a)hotmail.com>
> wrote:
>
>>Thanks.
>>
>>Is there better way? When we debug C#, VB, C code, we don't need add
>>addintional lines in original source code, we can use Watch/Command window
>>etc.
>>
>>If add addintional select scripts, then really no need go get into debug
>>mode at the first place.
>>
>>Thanks,
>>
>>
>>"Lijun Zhang" <sonyzhang00(a)yahoo.com> wrote in message
>>news:%23GUGwBoMLHA.3732(a)TK2MSFTNGP02.phx.gbl...
>>> The easiest way is put a SELECT statement in your SQL Scripts and remove
>>> it after the debug. You can use SELET to view your variable too. The
>>> result will always show the the output window.
>>>
>>> Lijun
>>>
>>>
>>>
>>> "Ryan Liu" <ryanliu_99(a)hotmail.com> wrote in message
>>> news:OGLEolnMLHA.4120(a)TK2MSFTNGP02.phx.gbl...
>>>
>>>> Hi,
>>>>
>>>> I know how to get into debug mode, place break point etc in a stroed
>>>> proc
>>>> in SQL Server Management Studio.
>>>>
>>>> But after it hits a break print, what actions I can take to peek the
>>>> data?
>>>> e.g. I try to see a temp table has just been populated?
>>>>
>>>> I can not put "select top 1 col1 from #tempTable1" in watch list. It
>>>> says
>>>> it could not be evalulated
>>>> I can not execute it in Command window.
>>>>
>>>> How can I look at data? How can I execute addintion sql statements?
>>>>
>>>> What command supported in "Command Window"?
>>>>
>>>> Thanks,
>>>>
>>>
>>>
> But with C# etc the variables/structures that you watch are in memory
> not in a database elsewehere!
>
> John


From: Ryan Liu on

"John Bell" <jbellnewsposts(a)hotmail.com> wrote in message
news:lpdf56l54479q33okdfnpjp2f4blr6i0ne(a)4ax.com...
> On Mon, 2 Aug 2010 13:39:55 -0700, "Ryan Liu" <ryanliu_99(a)hotmail.com>
> wrote:
>
>>Thanks.
>>
>>Is there better way? When we debug C#, VB, C code, we don't need add
>>addintional lines in original source code, we can use Watch/Command window
>>etc.
>>
>>If add addintional select scripts, then really no need go get into debug
>>mode at the first place.
>>
>>Thanks,
>>
>>
>>"Lijun Zhang" <sonyzhang00(a)yahoo.com> wrote in message
>>news:%23GUGwBoMLHA.3732(a)TK2MSFTNGP02.phx.gbl...
>>> The easiest way is put a SELECT statement in your SQL Scripts and remove
>>> it after the debug. You can use SELET to view your variable too. The
>>> result will always show the the output window.
>>>
>>> Lijun
>>>
>>>
>>>
>>> "Ryan Liu" <ryanliu_99(a)hotmail.com> wrote in message
>>> news:OGLEolnMLHA.4120(a)TK2MSFTNGP02.phx.gbl...
>>>
>>>> Hi,
>>>>
>>>> I know how to get into debug mode, place break point etc in a stroed
>>>> proc
>>>> in SQL Server Management Studio.
>>>>
>>>> But after it hits a break print, what actions I can take to peek the
>>>> data?
>>>> e.g. I try to see a temp table has just been populated?
>>>>
>>>> I can not put "select top 1 col1 from #tempTable1" in watch list. It
>>>> says
>>>> it could not be evalulated
>>>> I can not execute it in Command window.
>>>>
>>>> How can I look at data? How can I execute addintion sql statements?
>>>>
>>>> What command supported in "Command Window"?
>>>>
>>>> Thanks,
>>>>
>>>
>>>
> But with C# etc the variables/structures that you watch are in memory
> not in a database elsewehere!
>
> John

That's valid argument.
But what about command window?
And what about table variable? Or "select top1 col1 from @tableVariable", it
does not support either.

From: Erland Sommarskog on
Ryan Liu (ryanliu_99(a)hotmail.com) writes:
> Is there better way? When we debug C#, VB, C code, we don't need add
> addintional lines in original source code, we can use Watch/Command window
> etc.

You haven't see me debug my C++ code!

> If add addintional select scripts, then really no need go get into debug
> mode at the first place.

Yes, just like Lijun I never use the SQL debugger these days. I did use it
occasionally in the past, but there is often lots of problems to get it to
work at all.

And as you have discovered, you cannot peek into temp tables, table
variables etc. And I think that would be quite difficult to implement.

--
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