Showing posts with label t-sql. Show all posts
Showing posts with label t-sql. Show all posts

Friday, March 30, 2012

How to trim both side?

There are only LTRIM and RTRIM functions in T-SQL
But I want to trim both side.
How can I do?Use both :)
SELECT LTRIM(RTRIM(' this is a string with whitespace on both sides ')
--
Adam Machanic
Pro SQL Server 2005, available now
http://www.apress.com/book/bookDisplay.html?bID=457
--
"ad" <flying@.wfes.tcc.edu.tw> wrote in message
news:uyfpTXTfGHA.4828@.TK2MSFTNGP05.phx.gbl...
> There are only LTRIM and RTRIM functions in T-SQL
> But I want to trim both side.
> How can I do?
>

Sunday, February 19, 2012

How to step trough procedure in Debugger

I want to debug a procedure in Query analyzer. When I open the T-SQL debugger and add all the passing parameters the debugger runs very fast and the message shows "@.RETURN_VALUE = 0".

How can I toggle breakpoints and step trough each line of the scripts. The STEP INTO, STEP OVER, RUN TO THE CURSOR all are disabled. The Name and the values are not displayed.

Please help.

ThanksQ1 How can I toggle breakpoints and step trough each line of the scripts. The STEP INTO, STEP OVER, RUN TO THE CURSOR all are disabled. The Name and the values are not displayed.

A1 First, make sure debugger support was installed on your development Sql Server. (What you are describing may be a dev workstation with VB / VStudio installed running against a dev server that does not have debugging support installed?)

Note: It is advisable NOT to run the dubugger against a production server. The debugger can be very resource intensive (especially with regard to locked resources) and the debugger is NOT bug free.

A link to more information:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;310650|||SQL Server service must be logged on as non-System account:
Configure DCOM:
run dcomcnfg.exe
check DCOM settings (App.name is sqldbgreg)

For more see BOL "Troubleshooting the Transact-SQL Debugger" topic