Showing posts with label tsql. Show all posts
Showing posts with label tsql. Show all posts

Friday, March 30, 2012

Profiler

Hi,
I'm usin g profiler to trace TSQL (stmtstarting etc) and
there are 100s of rows with empty values for the textdata
column - any ideas why?
TIA
Not all events return data for every column. What events are these that have
the blank textdata values?
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Bob" <anonymous@.discussions.microsoft.com> wrote in message
news:ac8801c4d6fe$3192d480$a601280a@.phx.gbl...
> Hi,
> I'm usin g profiler to trace TSQL (stmtstarting etc) and
> there are 100s of rows with empty values for the textdata
> column - any ideas why?
> TIA
|||sp:stmtStarting, sp:stmtCompleted
|||Is it possible that the procedure is encrypted?
HTH
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Bob" <anonymous@.discussions.microsoft.com> wrote in message
news:187c01c4d707$1473e8e0$a501280a@.phx.gbl...
> sp:stmtStarting, sp:stmtCompleted
|||Kalen Delaney wrote:[vbcol=seagreen]
> Is it possible that the procedure is encrypted?
>
> "Bob" <anonymous@.discussions.microsoft.com> wrote in message
> news:187c01c4d707$1473e8e0$a501280a@.phx.gbl...
What I generally see with an encrypted SP in Profiler for
SP:StmtStarting/Completed is something like:
-- <sp_name> Encrypted Text
Strange.
David Gugick
Imceda Software
www.imceda.com

Wednesday, March 28, 2012

Profiler

Hi,
I'm usin g profiler to trace TSQL (stmtstarting etc) and
there are 100s of rows with empty values for the textdata
column - any ideas why?
TIANot all events return data for every column. What events are these that have
the blank textdata values?
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Bob" <anonymous@.discussions.microsoft.com> wrote in message
news:ac8801c4d6fe$3192d480$a601280a@.phx.gbl...
> Hi,
> I'm usin g profiler to trace TSQL (stmtstarting etc) and
> there are 100s of rows with empty values for the textdata
> column - any ideas why?
> TIA|||sp:stmtStarting, sp:stmtCompleted :)|||Is it possible that the procedure is encrypted?
--
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Bob" <anonymous@.discussions.microsoft.com> wrote in message
news:187c01c4d707$1473e8e0$a501280a@.phx.gbl...
> sp:stmtStarting, sp:stmtCompleted :)|||Kalen Delaney wrote:
> Is it possible that the procedure is encrypted?
>
> "Bob" <anonymous@.discussions.microsoft.com> wrote in message
> news:187c01c4d707$1473e8e0$a501280a@.phx.gbl...
>> sp:stmtStarting, sp:stmtCompleted :)
What I generally see with an encrypted SP in Profiler for
SP:StmtStarting/Completed is something like:
-- <sp_name> Encrypted Text
Strange.
David Gugick
Imceda Software
www.imceda.com

Profiler

Hi,
I'm usin g profiler to trace TSQL (stmtstarting etc) and
there are 100s of rows with empty values for the textdata
column - any ideas why?
TIANot all events return data for every column. What events are these that have
the blank textdata values?
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Bob" <anonymous@.discussions.microsoft.com> wrote in message
news:ac8801c4d6fe$3192d480$a601280a@.phx.gbl...
> Hi,
> I'm usin g profiler to trace TSQL (stmtstarting etc) and
> there are 100s of rows with empty values for the textdata
> column - any ideas why?
> TIA|||sp:stmtStarting, sp:stmtCompleted |||Is it possible that the procedure is encrypted?
HTH
--
Kalen Delaney
SQL Server MVP
www.SolidQualityLearning.com
"Bob" <anonymous@.discussions.microsoft.com> wrote in message
news:187c01c4d707$1473e8e0$a501280a@.phx.gbl...
> sp:stmtStarting, sp:stmtCompleted |||Kalen Delaney wrote:[vbcol=seagreen]
> Is it possible that the procedure is encrypted?
>
> "Bob" <anonymous@.discussions.microsoft.com> wrote in message
> news:187c01c4d707$1473e8e0$a501280a@.phx.gbl...
What I generally see with an encrypted SP in Profiler for
SP:StmtStarting/Completed is something like:
-- <sp_name> Encrypted Text
Strange.
David Gugick
Imceda Software
www.imceda.com

Tuesday, March 20, 2012

Processing the TEXT datatype with TSQL

Hi;

I have a table with a TEXT datatype.
Its a comment field.

Right now the users who put in singlequotes are killing the web front
end.

The programmer responsible is fixing this issue but it might be a few
weeks until we get the patch.

I would like to write a trigger that whenever this field is updated it
will scan the text for single quotes ( and hard returns \r ) and
extract them.

I found some nice string functions in HELP.

Will these string functions work with the TEXT datatype in a TSQL
script/trigger?

Thanks in advance

SteveI handle quotes with the REPLACE function. All languages that I work with
has it.

Two single quotes in a row signify an escape sequence from the normal
interpretation of the single quote character. When two single quotes appear
together, they are interpreted by SQL as one literal single quote. All we
need do, then, is replace any single quote with two single quotes in strings
that we want interpreted literally by SQL.

This won't work on a Text datatype, however it does work on varchars and
stuff. Check your max len() on that field and see if it actually is using
more than the capacity of other datatypes and see about changing it to
varchar or something. This t-sql replaces one quote with two and would save
your web person endless hours of javascript'ing validation code!!

Select REPLACE(testColumn, char(39), char(39) + char(39)) as texta from
myTable

After all, quotes are valid characters too!!!

Good luck!

--
Jerry Boone
Analytical Technologies, Inc.
http://www.antech.biz

"Steve" <stevesusenet@.yahoo.com> wrote in message
news:6f8cb8c9.0311140657.59346a15@.posting.google.c om...
> Hi;
> I have a table with a TEXT datatype.
> Its a comment field.
> Right now the users who put in singlequotes are killing the web front
> end.
> The programmer responsible is fixing this issue but it might be a few
> weeks until we get the patch.
> I would like to write a trigger that whenever this field is updated it
> will scan the text for single quotes ( and hard returns \r ) and
> extract them.
> I found some nice string functions in HELP.
> Will these string functions work with the TEXT datatype in a TSQL
> script/trigger?
> Thanks in advance
> Steve

Wednesday, March 7, 2012

Process Details/Last TSQL command batch for SPID

Is there a way to view the "Process Details/Last TSQL command batch" for a
given SPID from Query Analyser? In EM if you go to > Managment > Current
Activity > Process Info > and then double click on a SPID, you can view the
Process Details/Last TSQL command batch.
From QA I would like to be able see the same info by running a SPROC like
"sp_SPID_Details(51)". I know that SPROC doesn't exist, but is there
something similar?eHi
You could try DBCC INPUTBUFFER to get some information back. See Books
online for more.
John
"Dan" wrote:
> Is there a way to view the "Process Details/Last TSQL command batch" for a
> given SPID from Query Analyser? In EM if you go to > Managment > Current
> Activity > Process Info > and then double click on a SPID, you can view the
> Process Details/Last TSQL command batch.
> From QA I would like to be able see the same info by running a SPROC like
> "sp_SPID_Details(51)". I know that SPROC doesn't exist, but is there
> something similar?